:root{
  --hhv2-bg:#070914;
  --hhv2-panel:#0d1020;
  --hhv2-panel-2:#11152a;
  --hhv2-line:rgba(147,165,255,.15);
  --hhv2-text:#f4f7ff;
  --hhv2-muted:#8d98b8;
  --hhv2-accent:#655cff;
  --hhv2-accent2:#37b8ea;
}
*{box-sizing:border-box}
.hhv2-root{font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;background:var(--hhv2-bg);color:var(--hhv2-text);display:grid;grid-template-columns:280px minmax(0,1fr);height:100dvh;overflow:hidden}
.hhv2-sidebar{min-width:0;background:linear-gradient(180deg,#0a0d1b,#080a16);border-right:1px solid var(--hhv2-line);display:flex;flex-direction:column;overflow:hidden}
.hhv2-brand{height:64px;display:flex;align-items:center;gap:10px;padding:0 16px;border-bottom:1px solid var(--hhv2-line)}
.hhv2-logo{width:34px;height:34px;border-radius:11px;display:grid;place-items:center;font-weight:900;background:linear-gradient(145deg,var(--hhv2-accent),var(--hhv2-accent2));box-shadow:0 10px 28px rgba(74,111,255,.28)}
.hhv2-brand strong{font-size:14px;letter-spacing:.04em}.hhv2-brand small{display:block;color:var(--hhv2-muted);font-size:10px;margin-top:2px}
.hhv2-new{margin:12px 12px 8px;min-height:42px;border:1px solid rgba(103,112,255,.35);border-radius:13px;background:rgba(95,86,255,.14);color:#fff;font-weight:800;cursor:pointer}.hhv2-new:hover{background:rgba(95,86,255,.22)}
.hhv2-list{flex:1;overflow:auto;padding:4px 8px 18px;scrollbar-width:thin;scrollbar-color:rgba(140,160,255,.25) transparent}
.hhv2-section{padding:10px 9px 6px;color:#6f7898;font-size:10px;font-weight:900;letter-spacing:.12em;text-transform:uppercase}
.hhv2-chat-row{width:100%;display:block;border:0;background:transparent;color:#dfe5f8;border-radius:11px;padding:10px 10px;text-align:left;cursor:pointer;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:13px}.hhv2-chat-row:hover{background:rgba(115,129,215,.09)}.hhv2-chat-row.is-active{background:rgba(91,88,255,.17);color:#fff}
.hhv2-account{border-top:1px solid var(--hhv2-line);padding:12px 14px;color:var(--hhv2-muted);font-size:11px;display:flex;justify-content:space-between;gap:10px}.hhv2-credit{color:#dce4ff;font-weight:800}
.hhv2-main{min-width:0;display:grid;grid-template-rows:56px minmax(0,1fr) auto;height:100dvh;overflow:hidden}
.hhv2-topbar{display:flex;align-items:center;gap:10px;padding:0 18px;border-bottom:1px solid var(--hhv2-line);background:rgba(7,9,20,.94)}
.hhv2-menu{display:none;width:38px;height:38px;border:1px solid var(--hhv2-line);border-radius:11px;background:#101426;color:#fff;font-size:19px;cursor:pointer}
.hhv2-title{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:800;font-size:14px}.hhv2-status{margin-left:auto;color:#6f7898;font-size:11px}
.hhv2-messages{overflow:auto;overscroll-behavior:contain;padding:24px max(18px,calc((100% - 840px)/2)) 34px;scrollbar-width:thin;scrollbar-color:rgba(140,160,255,.22) transparent}
.hhv2-empty{min-height:100%;display:grid;place-items:center;text-align:center;padding:30px}.hhv2-empty-card{max-width:520px}.hhv2-empty .hhv2-logo{margin:0 auto 16px;width:48px;height:48px}.hhv2-empty h2{margin:0 0 8px;font-size:24px}.hhv2-empty p{margin:0;color:var(--hhv2-muted);line-height:1.55}
.hhv2-msg{display:flex;margin:0 0 18px}.hhv2-msg.is-user{justify-content:flex-end}.hhv2-bubble{max-width:min(760px,88%);font-size:14px;line-height:1.58;white-space:pre-wrap;overflow-wrap:anywhere}.hhv2-msg.is-user .hhv2-bubble{padding:11px 14px;border-radius:17px 17px 5px 17px;background:linear-gradient(145deg,#5960e9,#3b83d7);color:#fff}.hhv2-msg.is-assistant .hhv2-bubble{padding:2px 0;color:#edf2ff}
.hhv2-bubble.is-thinking{color:#8f9aba}.hhv2-bubble.is-thinking:after{content:"";display:inline-block;width:14px;animation:hhv2Dots 1.2s steps(4,end) infinite}@keyframes hhv2Dots{0%{content:""}25%{content:"."}50%{content:".."}75%,100%{content:"..."}}
.hhv2-sources{display:flex;gap:7px;flex-wrap:wrap;margin-top:10px}.hhv2-sources a{display:inline-flex;max-width:210px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding:6px 9px;border:1px solid var(--hhv2-line);border-radius:10px;color:#aebfff;text-decoration:none;font-size:10px}.hhv2-sources a:hover{border-color:rgba(90,189,242,.44);color:#fff}
.hhv2-older{display:block;margin:0 auto 24px;border:1px solid var(--hhv2-line);border-radius:11px;padding:8px 12px;background:#101426;color:#cfd7f4;cursor:pointer;font-size:11px}
.hhv2-composer-wrap{padding:10px 16px max(12px,env(safe-area-inset-bottom));border-top:1px solid var(--hhv2-line);background:linear-gradient(180deg,rgba(7,9,20,.72),#070914)}
.hhv2-composer{width:min(880px,100%);margin:0 auto;display:grid;grid-template-columns:40px minmax(0,1fr) 46px;gap:8px;padding:8px;border:1px solid rgba(142,160,255,.2);border-radius:19px;background:#0d1125;box-shadow:0 18px 45px rgba(0,0,0,.28)}
.hhv2-input{width:100%;min-height:46px;max-height:130px;resize:none;border:0;outline:0;padding:12px 13px;background:transparent;color:#fff;font:inherit;font-size:14px;line-height:1.45}.hhv2-input::placeholder{color:#77809e}
.hhv2-send{width:46px;height:46px;border:0;border-radius:14px;background:linear-gradient(145deg,var(--hhv2-accent),var(--hhv2-accent2));color:#fff;font-size:18px;font-weight:900;cursor:pointer}.hhv2-send:disabled{opacity:.45;cursor:default}
.hhv2-error{max-width:880px;margin:0 auto 8px;color:#ffb8c0;font-size:11px;padding:0 4px}.hhv2-loading{padding:16px;color:var(--hhv2-muted);font-size:12px}
.hhv2-login{position:fixed;inset:0;background:#070914;color:#fff;display:grid;place-items:center;text-align:center;font-family:system-ui,sans-serif;z-index:2147480000}.hhv2-login>div{max-width:440px;padding:30px}.hhv2-login h1{margin:14px 0 6px}.hhv2-login p{color:#929dbc}.hhv2-login a{display:inline-flex;margin-top:14px;padding:11px 18px;border-radius:12px;color:#fff;text-decoration:none;background:linear-gradient(145deg,#655cff,#37b8ea)}.hhv2-logo-mark{width:48px;height:48px;margin:auto;border-radius:14px;display:grid;place-items:center;font-weight:900;background:linear-gradient(145deg,#655cff,#37b8ea)}
.hhv2-overlay{display:none}
@media(max-width:820px){
  .hhv2-root{grid-template-columns:minmax(0,1fr)}
  .hhv2-sidebar{position:fixed;left:0;top:0;bottom:0;width:min(310px,86vw);z-index:50;transform:translateX(-102%);transition:transform .18s ease;box-shadow:22px 0 60px rgba(0,0,0,.5)}
  .hhv2-root.is-sidebar-open .hhv2-sidebar{transform:translateX(0)}
  .hhv2-overlay{display:block;position:fixed;inset:0;z-index:45;border:0;background:rgba(0,0,0,.54);opacity:0;pointer-events:none;transition:opacity .18s ease}.hhv2-root.is-sidebar-open .hhv2-overlay{opacity:1;pointer-events:auto}
  .hhv2-menu{display:inline-grid;place-items:center}
  .hhv2-topbar{padding:0 10px}.hhv2-messages{padding:20px 14px 28px}.hhv2-composer-wrap{padding:8px 10px max(10px,env(safe-area-inset-bottom))}.hhv2-bubble{max-width:92%}
}

/* v0.4.0: lightweight AI controls + lazy Trip Planner loader. */
.hhv2-tools{width:min(880px,100%);margin:0 auto 6px;display:flex;align-items:center;gap:7px;min-height:28px}
.hhv2-web-toggle,.hhv2-trip-toggle,.hhv2-drive-toggle,.hhv2-gemini-state{height:28px;display:inline-flex;align-items:center;justify-content:center;padding:0 10px;border:1px solid var(--hhv2-line);border-radius:10px;background:rgba(16,20,38,.82);color:#9da8c7;font-size:10px;font-weight:800;line-height:1;white-space:nowrap}
.hhv2-web-toggle,.hhv2-trip-toggle,.hhv2-drive-toggle{cursor:pointer;font-family:inherit}
.hhv2-web-toggle:hover,.hhv2-trip-toggle:hover,.hhv2-drive-toggle:hover{border-color:rgba(81,184,239,.40);color:#edf4ff}
.hhv2-web-toggle.is-on,.hhv2-trip-toggle.is-on,.hhv2-drive-toggle.is-on{border-color:rgba(63,190,235,.48);background:rgba(48,137,208,.15);color:#dff7ff}
.hhv2-gemini-state.is-ready{border-color:rgba(133,103,255,.30);background:rgba(100,82,220,.10);color:#c8c2ff}
.hhv2-ai-meta{display:flex;gap:6px;flex-wrap:wrap;margin-top:9px}
.hhv2-ai-chip{display:inline-flex;align-items:center;min-height:24px;padding:0 8px;border:1px solid var(--hhv2-line);border-radius:9px;font-size:9px;font-weight:850;letter-spacing:.01em;background:rgba(16,20,38,.74);color:#a8b3d0}
.hhv2-ai-chip.is-web{border-color:rgba(63,190,235,.28);color:#9ee8ff}
.hhv2-ai-chip.is-gemini{border-color:rgba(133,103,255,.28);color:#c9c2ff}
@media(max-width:820px){.hhv2-tools{padding:0 2px;margin-bottom:5px}.hhv2-web-toggle,.hhv2-trip-toggle,.hhv2-drive-toggle,.hhv2-gemini-state{height:27px;padding:0 9px}}

/* v0.6.1: Drive mode uses the same compact control language as the rest of V2. */
.hhv2-drive-toggle{position:relative;gap:6px;transition:border-color .16s ease,background .16s ease,color .16s ease,box-shadow .16s ease}
.hhv2-drive-toggle::before{content:"";width:6px;height:6px;flex:0 0 6px;border-radius:50%;background:#66718f;box-shadow:0 0 0 3px rgba(102,113,143,.08)}
.hhv2-drive-toggle.is-on::before{background:#40d6c4;box-shadow:0 0 0 4px rgba(64,214,196,.10)}
.hhv2-drive-toggle.is-on{box-shadow:inset 0 1px 0 rgba(255,255,255,.025)}
.hhv2-drive-toggle:disabled{opacity:.58;cursor:wait}


/* v0.8.1: device location control. Location is requested only when the user taps it. */
.hhv2-location-toggle{height:28px;display:inline-flex;align-items:center;justify-content:center;max-width:220px;padding:0 10px;border:1px solid var(--hhv2-line);border-radius:10px;background:rgba(16,20,38,.82);color:#9da8c7;font-family:inherit;font-size:10px;font-weight:800;line-height:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;cursor:pointer}
.hhv2-location-toggle:hover{border-color:rgba(64,214,196,.42);color:#edfdfb}
.hhv2-location-toggle.is-on{border-color:rgba(64,214,196,.38);background:rgba(64,214,196,.09);color:#baf9ef}
.hhv2-location-toggle:disabled{opacity:.62;cursor:wait}
@media(max-width:820px){.hhv2-location-toggle{height:27px;max-width:150px;padding:0 9px}.hhv2-tools{overflow-x:auto;scrollbar-width:none}.hhv2-tools::-webkit-scrollbar{display:none}}

/* v0.8.3 — conversation delete control */
.hhv2-chat-item{position:relative;display:flex;align-items:center;gap:3px;border-radius:11px;min-width:0}
.hhv2-chat-item.is-active{background:rgba(91,88,255,.17)}
.hhv2-chat-item .hhv2-chat-row{flex:1;min-width:0;width:auto;background:transparent}
.hhv2-chat-item.is-active .hhv2-chat-row{background:transparent;color:#fff}
.hhv2-chat-delete{width:30px;height:30px;flex:0 0 30px;display:grid;place-items:center;padding:0;margin-right:3px;border:0;border-radius:9px;background:transparent;color:#7f89a8;cursor:pointer;opacity:0;transform:scale(.94);transition:opacity .14s ease,background .14s ease,color .14s ease,transform .14s ease}
.hhv2-chat-delete svg{width:15px;height:15px;fill:currentColor;pointer-events:none}
.hhv2-chat-item:hover .hhv2-chat-delete,.hhv2-chat-item:focus-within .hhv2-chat-delete{opacity:1;transform:scale(1)}
.hhv2-chat-delete:hover{background:rgba(255,76,103,.12);color:#ff7f94}
.hhv2-chat-delete:focus-visible{opacity:1;outline:2px solid rgba(255,127,148,.55);outline-offset:1px}
.hhv2-chat-delete:disabled{opacity:.35;cursor:wait}
@media(max-width:850px){.hhv2-chat-delete{opacity:.85;transform:none}}

/* v0.8.4 — permanent delete controls */
.hhv2-section-row{display:flex;align-items:center;justify-content:space-between;gap:8px}
.hhv2-clear-chats{border:0;background:transparent;color:#7f89a8;font:inherit;font-size:10px;font-weight:800;letter-spacing:.02em;cursor:pointer;padding:5px 6px;border-radius:7px}
.hhv2-clear-chats:hover{background:rgba(255,76,103,.10);color:#ff8296}
.hhv2-clear-chats:focus-visible{outline:2px solid rgba(255,127,148,.5);outline-offset:1px}

/* v1.0.1: assistant links are clickable without enabling model-provided HTML. */
.hhv2-rich-link{color:#75bfff;text-decoration:underline;text-decoration-thickness:1px;text-underline-offset:3px;word-break:break-word}
.hhv2-rich-link:hover{color:#b8dcff}
.hhv2-rich-link:focus-visible{outline:2px solid rgba(83,183,255,.65);outline-offset:2px;border-radius:3px}
.hhv2-rich-strong{font-weight:750;color:#fff}


/* v1.0.2 — background chat answers. A conversation can keep thinking while
   the user opens another chat; the sidebar subtly marks in-flight chats. */
.hhv2-chat-item.is-thinking .hhv2-chat-row{position:relative;padding-right:28px}
.hhv2-chat-item.is-thinking .hhv2-chat-row::after{content:"";position:absolute;right:10px;top:50%;width:7px;height:7px;margin-top:-3.5px;border-radius:50%;background:#34d399;box-shadow:0 0 0 0 rgba(52,211,153,.35);animation:hhv2ThinkingPulse 1.35s ease-out infinite}
@keyframes hhv2ThinkingPulse{0%{box-shadow:0 0 0 0 rgba(52,211,153,.35)}70%{box-shadow:0 0 0 7px rgba(52,211,153,0)}100%{box-shadow:0 0 0 0 rgba(52,211,153,0)}}


/* v1.1.0 — private multimodal attachments. */
.hhv2-file-input{display:none!important}
.hhv2-attach{width:40px;height:46px;border:1px solid rgba(142,160,255,.16);border-radius:13px;background:rgba(20,25,48,.72);color:#aeb9d9;font:700 23px/1 system-ui,sans-serif;cursor:pointer;display:grid;place-items:center;padding:0;transition:border-color .15s ease,background .15s ease,color .15s ease}
.hhv2-attach:hover{border-color:rgba(77,190,239,.42);background:rgba(38,75,105,.22);color:#fff}.hhv2-attach:disabled{opacity:.42;cursor:default}
.hhv2-attachments{width:min(880px,100%);margin:0 auto 7px;display:flex;gap:7px;overflow-x:auto;scrollbar-width:none}.hhv2-attachments::-webkit-scrollbar{display:none}.hhv2-attachments.is-empty{display:none}
.hhv2-attachment-chip{min-width:0;max-width:260px;display:flex;align-items:center;gap:8px;padding:7px 8px 7px 10px;border:1px solid rgba(142,160,255,.18);border-radius:12px;background:#10152a;color:#e9eeff}
.hhv2-attachment-icon{font-size:15px;flex:0 0 auto}.hhv2-attachment-info{min-width:0;display:flex;flex-direction:column;line-height:1.15}.hhv2-attachment-info strong{font-size:10px;max-width:185px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.hhv2-attachment-info small{font-size:9px;color:#7f8aa8;margin-top:3px}
.hhv2-attachment-remove{width:24px;height:24px;flex:0 0 24px;border:0;border-radius:8px;background:transparent;color:#8c96b5;font-size:17px;cursor:pointer;padding:0}.hhv2-attachment-remove:hover{background:rgba(255,80,105,.12);color:#ff8b9d}
@media(max-width:820px){.hhv2-composer{grid-template-columns:38px minmax(0,1fr) 46px}.hhv2-attach{width:38px}.hhv2-attachment-chip{max-width:220px}.hhv2-attachment-info strong{max-width:150px}}

/* v1.6.6 branding cleanup: keep provider implementation private from UI */
.hhv2-gemini,
.hhv2-gemini-status,
[data-provider="gemini"],
[data-ai-provider="gemini"] {
  display: none !important;
}


/* v1.7.3 account actions: Dashboard + Log out */
.hhv2-account{
  gap:8px;
}
.hhv2-account-info{
  min-width:0;
  flex:1 1 auto;
  display:flex;
  align-items:center;
  gap:8px;
}
.hhv2-account-name{
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.hhv2-account-actions{
  flex:0 0 auto;
  display:flex;
  align-items:center;
  gap:5px;
}
.hhv2-account-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:26px;
  padding:0 7px;
  border:1px solid rgba(255,255,255,.12);
  border-radius:7px;
  background:rgba(255,255,255,.045);
  color:#cfd4e6;
  text-decoration:none;
  font-size:10px;
  font-weight:750;
  line-height:1;
  white-space:nowrap;
}
.hhv2-account-btn:hover{
  color:#fff;
  background:rgba(255,255,255,.09);
  border-color:rgba(255,255,255,.22);
}

/* v1.7.4 image attachment previews */
.hhv2-attachment-chip{
  overflow:hidden;
}
.hhv2-attachment-thumb{
  width:46px;
  height:46px;
  flex:0 0 46px;
  object-fit:cover;
  border-radius:9px;
  border:1px solid rgba(255,255,255,.12);
  background:#0a0d18;
}
.hhv2-message-images{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-top:9px;
}
.hhv2-message-image-item{
  max-width:min(320px,100%);
}
.hhv2-message-image{
  display:block;
  max-width:100%;
  width:auto;
  max-height:260px;
  object-fit:contain;
  border-radius:12px;
  border:1px solid rgba(255,255,255,.12);
  background:#080b14;
}
.hhv2-message-image-name{
  display:block;
  margin-top:4px;
  max-width:280px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  color:#9aa5c3;
  font-size:10px;
}
@media (max-width:700px){
  .hhv2-message-image{max-height:220px}
  .hhv2-attachment-thumb{width:42px;height:42px;flex-basis:42px}
}

/* v1.7.7 Light / Dark theme toggle */
html[data-hhv2-theme="light"] body,
body[data-hhv2-theme="light"]{
  background:#f4f7fb !important;
  color:#172033 !important;
}

html[data-hhv2-theme="light"] .hhv2-shell,
html[data-hhv2-theme="light"] .hhv2-main,
html[data-hhv2-theme="light"] .hhv2-stage,
html[data-hhv2-theme="light"] .hhv2-content,
html[data-hhv2-theme="light"] .hhv2-chat{
  background:#f4f7fb !important;
  color:#172033 !important;
}

html[data-hhv2-theme="light"] .hhv2-sidebar{
  background:#ffffff !important;
  border-color:#dbe3ef !important;
  color:#172033 !important;
}

html[data-hhv2-theme="light"] .hhv2-brand,
html[data-hhv2-theme="light"] .hhv2-topbar,
html[data-hhv2-theme="light"] .hhv2-account{
  background:#ffffff !important;
  border-color:#dbe3ef !important;
  color:#172033 !important;
}

html[data-hhv2-theme="light"] .hhv2-new-chat,
html[data-hhv2-theme="light"] .hhv2-account-btn,
html[data-hhv2-theme="light"] .hhv2-mode-btn,
html[data-hhv2-theme="light"] .hhv2-chip,
html[data-hhv2-theme="light"] .hhv2-tool-btn{
  background:#f8fafc !important;
  color:#263348 !important;
  border-color:#cfd9e8 !important;
}

html[data-hhv2-theme="light"] .hhv2-new-chat:hover,
html[data-hhv2-theme="light"] .hhv2-account-btn:hover,
html[data-hhv2-theme="light"] .hhv2-mode-btn:hover,
html[data-hhv2-theme="light"] .hhv2-chip:hover,
html[data-hhv2-theme="light"] .hhv2-tool-btn:hover{
  background:#edf2f8 !important;
  color:#111827 !important;
}

html[data-hhv2-theme="light"] .hhv2-chat-item,
html[data-hhv2-theme="light"] .hhv2-chat-row,
html[data-hhv2-theme="light"] .hhv2-history-item{
  color:#243249 !important;
}

html[data-hhv2-theme="light"] .hhv2-chat-item:hover,
html[data-hhv2-theme="light"] .hhv2-chat-item.is-active,
html[data-hhv2-theme="light"] .hhv2-chat-row:hover,
html[data-hhv2-theme="light"] .hhv2-chat-row.is-active{
  background:#edf2f8 !important;
}

html[data-hhv2-theme="light"] .hhv2-empty,
html[data-hhv2-theme="light"] .hhv2-empty h1,
html[data-hhv2-theme="light"] .hhv2-empty h2,
html[data-hhv2-theme="light"] .hhv2-empty p{
  color:#273449 !important;
}

html[data-hhv2-theme="light"] .hhv2-bubble{
  background:#ffffff !important;
  color:#172033 !important;
  border-color:#dbe3ef !important;
}

html[data-hhv2-theme="light"] .hhv2-message.is-user .hhv2-bubble,
html[data-hhv2-theme="light"] .hhv2-message.is-user .hhv2-user-bubble{
  background:#4f7ee8 !important;
  color:#ffffff !important;
  border-color:#4f7ee8 !important;
}

html[data-hhv2-theme="light"] .hhv2-composer-wrap{
  background:linear-gradient(transparent,#f4f7fb 34%) !important;
}

html[data-hhv2-theme="light"] .hhv2-composer{
  background:#ffffff !important;
  border-color:#cfd9e8 !important;
  box-shadow:0 12px 34px rgba(40,55,85,.12) !important;
}

html[data-hhv2-theme="light"] .hhv2-composer textarea,
html[data-hhv2-theme="light"] .hhv2-composer input{
  color:#172033 !important;
  background:transparent !important;
}

html[data-hhv2-theme="light"] .hhv2-composer textarea::placeholder,
html[data-hhv2-theme="light"] .hhv2-composer input::placeholder{
  color:#7a879b !important;
}

html[data-hhv2-theme="light"] .hhv2-attachments,
html[data-hhv2-theme="light"] .hhv2-attachment-chip{
  background:#ffffff !important;
  color:#25334a !important;
  border-color:#cfd9e8 !important;
}

html[data-hhv2-theme="light"] .hhv2-trip-panel,
html[data-hhv2-theme="light"] .hhv2-trip-card,
html[data-hhv2-theme="light"] .hhv2-trip-choice,
html[data-hhv2-theme="light"] .hhv2-route-card{
  background:#ffffff !important;
  color:#172033 !important;
  border-color:#d6dfeb !important;
}

html[data-hhv2-theme="light"] .hhv2-trip-panel input,
html[data-hhv2-theme="light"] .hhv2-trip-panel select,
html[data-hhv2-theme="light"] .hhv2-trip-panel textarea{
  background:#f8fafc !important;
  color:#172033 !important;
  border-color:#cfd9e8 !important;
}

html[data-hhv2-theme="light"] .hhv2-account-name,
html[data-hhv2-theme="light"] .hhv2-credit,
html[data-hhv2-theme="light"] .hhv2-sidebar-title,
html[data-hhv2-theme="light"] .hhv2-recent-title{
  color:#263348 !important;
}

html[data-hhv2-theme="light"] a{
  color:#315ecb;
}

/* Keep media itself unchanged in light mode. */
html[data-hhv2-theme="light"] .hhv2-message-image,
html[data-hhv2-theme="light"] .hhv2-attachment-thumb{
  background:#eef2f7 !important;
}

/* Smooth switch without changing layout. */
.hhv2-shell,
.hhv2-sidebar,
.hhv2-main,
.hhv2-composer,
.hhv2-bubble,
.hhv2-trip-panel,
.hhv2-account{
  transition:background-color .18s ease,color .18s ease,border-color .18s ease;
}

/* v1.7.8 light mode readability corrections */
html[data-hhv2-theme="light"] .hhv2-msg.is-user .hhv2-bubble{
  background:#4f7ee8 !important;
  color:#ffffff !important;
  border-color:#4f7ee8 !important;
}
html[data-hhv2-theme="light"] .hhv2-msg.is-user .hhv2-bubble *{
  color:#ffffff !important;
}
html[data-hhv2-theme="light"] .hhv2-msg.is-assistant .hhv2-bubble{
  background:#ffffff !important;
  color:#172033 !important;
  border:1px solid #dbe3ef !important;
}
html[data-hhv2-theme="light"] .hhv2-msg.is-assistant .hhv2-bubble p,
html[data-hhv2-theme="light"] .hhv2-msg.is-assistant .hhv2-bubble span,
html[data-hhv2-theme="light"] .hhv2-msg.is-assistant .hhv2-bubble strong,
html[data-hhv2-theme="light"] .hhv2-msg.is-assistant .hhv2-bubble em,
html[data-hhv2-theme="light"] .hhv2-msg.is-assistant .hhv2-bubble li,
html[data-hhv2-theme="light"] .hhv2-msg.is-assistant .hhv2-bubble h1,
html[data-hhv2-theme="light"] .hhv2-msg.is-assistant .hhv2-bubble h2,
html[data-hhv2-theme="light"] .hhv2-msg.is-assistant .hhv2-bubble h3,
html[data-hhv2-theme="light"] .hhv2-msg.is-assistant .hhv2-bubble h4,
html[data-hhv2-theme="light"] .hhv2-msg.is-assistant .hhv2-bubble code,
html[data-hhv2-theme="light"] .hhv2-msg.is-assistant .hhv2-bubble blockquote{
  color:#172033 !important;
}
html[data-hhv2-theme="light"] .hhv2-msg.is-assistant .hhv2-bubble a{
  color:#2458c6 !important;
  text-decoration-color:#2458c6 !important;
}
html[data-hhv2-theme="light"] .hhv2-msg.is-assistant .hhv2-sources a{
  background:#eef3fb !important;
  color:#234eaa !important;
  border-color:#cdd9ec !important;
}
html[data-hhv2-theme="light"] .hhv2-mode-btn.is-active,
html[data-hhv2-theme="light"] .hhv2-chip.is-active,
html[data-hhv2-theme="light"] .hhv2-location-btn,
html[data-hhv2-theme="light"] .hhv2-location-chip{
  background:#e2f6f1 !important;
  color:#0c5b50 !important;
  border-color:#83cfc1 !important;
}
html[data-hhv2-theme="light"] .hhv2-status,
html[data-hhv2-theme="light"] .hhv2-title,
html[data-hhv2-theme="light"] .hhv2-brand strong,
html[data-hhv2-theme="light"] .hhv2-brand small{
  color:#172033 !important;
}
html[data-hhv2-theme="light"] .hhv2-older{
  background:#ffffff !important;
  color:#263348 !important;
  border-color:#cfd9e8 !important;
}
html[data-hhv2-theme="light"] .hhv2-trip-panel button,
html[data-hhv2-theme="light"] .hhv2-trip-card button,
html[data-hhv2-theme="light"] .hhv2-route-card button{
  color:#17324f !important;
}

/* v1.7.9 light-mode location pill contrast */
html[data-hhv2-theme="light"] .hhv2-location-btn,
html[data-hhv2-theme="light"] .hhv2-location-chip,
html[data-hhv2-theme="light"] [class*="location"]{
  color:#0f5132 !important;
}

html[data-hhv2-theme="light"] .hhv2-location-btn,
html[data-hhv2-theme="light"] .hhv2-location-chip{
  background:#d9f5e8 !important;
  border-color:#58b98a !important;
  box-shadow:0 0 0 1px rgba(88,185,138,.15) inset !important;
  font-weight:800 !important;
}

html[data-hhv2-theme="light"] .hhv2-location-btn:hover,
html[data-hhv2-theme="light"] .hhv2-location-chip:hover{
  background:#c6efdd !important;
  border-color:#3c9f70 !important;
  color:#0b3d27 !important;
}

/* Also cover the compact toolbar chip used by the current location badge. */
html[data-hhv2-theme="light"] .hhv2-toolbar .is-location,
html[data-hhv2-theme="light"] .hhv2-toolbar [data-location],
html[data-hhv2-theme="light"] .hhv2-controls .is-location,
html[data-hhv2-theme="light"] .hhv2-controls [data-location]{
  background:#d9f5e8 !important;
  color:#0f5132 !important;
  border-color:#58b98a !important;
  font-weight:800 !important;
}

/* v1.8.1 Mobile UI pass — desktop remains unchanged */
@media (max-width: 760px){

  html, body{
    width:100%;
    max-width:100%;
    overflow-x:hidden;
  }

  .hhv2-shell{
    min-height:100dvh !important;
    height:100dvh !important;
  }

  .hhv2-main{
    min-width:0 !important;
    width:100% !important;
  }

  .hhv2-topbar{
    min-height:58px !important;
    padding:8px 12px !important;
    gap:8px !important;
  }

  .hhv2-title{
    min-width:0 !important;
    overflow:hidden !important;
    text-overflow:ellipsis !important;
    white-space:nowrap !important;
    font-size:15px !important;
  }

  .hhv2-status{
    flex:0 0 auto !important;
    font-size:11px !important;
  }

  .hhv2-messages{
    padding:16px 12px 190px !important;
    scroll-padding-bottom:190px !important;
  }

  .hhv2-msg{
    max-width:100% !important;
  }

  .hhv2-msg.is-user{
    padding-left:34px !important;
  }

  .hhv2-msg.is-assistant{
    padding-right:10px !important;
  }

  .hhv2-bubble{
    max-width:100% !important;
    font-size:15px !important;
    line-height:1.55 !important;
    overflow-wrap:anywhere !important;
    word-break:break-word !important;
  }

  .hhv2-message-image{
    max-width:100% !important;
    width:auto !important;
    height:auto !important;
    max-height:360px !important;
  }

  .hhv2-message-image-item{
    max-width:100% !important;
  }

  .hhv2-composer-wrap{
    position:fixed !important;
    left:0 !important;
    right:0 !important;
    bottom:0 !important;
    z-index:80 !important;
    padding:8px 10px calc(10px + env(safe-area-inset-bottom)) !important;
    background:linear-gradient(transparent, var(--hhv2-bg, #080b14) 24%) !important;
  }

  html[data-hhv2-theme="light"] .hhv2-composer-wrap{
    background:linear-gradient(transparent,#f4f7fb 24%) !important;
  }

  .hhv2-composer{
    width:100% !important;
    max-width:none !important;
    border-radius:18px !important;
    padding:7px !important;
    gap:7px !important;
  }

  .hhv2-composer textarea,
  .hhv2-composer input{
    min-width:0 !important;
    font-size:16px !important; /* prevents iOS zoom */
  }

  .hhv2-composer button{
    min-width:46px !important;
    min-height:46px !important;
  }

  .hhv2-controls,
  .hhv2-toolbar,
  .hhv2-modebar{
    overflow-x:auto !important;
    overflow-y:hidden !important;
    white-space:nowrap !important;
    flex-wrap:nowrap !important;
    scrollbar-width:none !important;
    -webkit-overflow-scrolling:touch !important;
    padding-bottom:3px !important;
  }

  .hhv2-controls::-webkit-scrollbar,
  .hhv2-toolbar::-webkit-scrollbar,
  .hhv2-modebar::-webkit-scrollbar{
    display:none !important;
  }

  .hhv2-mode-btn,
  .hhv2-location-btn,
  .hhv2-location-chip,
  .hhv2-chip{
    flex:0 0 auto !important;
    max-width:210px !important;
    overflow:hidden !important;
    text-overflow:ellipsis !important;
    white-space:nowrap !important;
  }

  .hhv2-attachments{
    max-width:100% !important;
    overflow-x:auto !important;
  }

  .hhv2-attachment-chip{
    min-width:0 !important;
    max-width:260px !important;
  }

  .hhv2-attachment-info{
    min-width:0 !important;
  }

  .hhv2-attachment-info strong{
    display:block !important;
    overflow:hidden !important;
    text-overflow:ellipsis !important;
    white-space:nowrap !important;
  }

  .hhv2-account{
    padding-bottom:calc(10px + env(safe-area-inset-bottom)) !important;
  }

  .hhv2-account-actions{
    gap:4px !important;
  }

  .hhv2-account-btn{
    min-height:30px !important;
    padding:0 7px !important;
    font-size:10px !important;
  }

  /* Sidebar drawer on mobile only */
  .hhv2-sidebar{
    width:min(86vw,320px) !important;
    max-width:320px !important;
  }

  /* Reduce empty-state vertical waste on phones */
  .hhv2-empty{
    min-height:calc(100dvh - 250px) !important;
    padding:56px 20px 150px !important;
  }
}

/* v1.8.2 mobile sidebar footer visibility */
@media (max-width:760px){

  .hhv2-sidebar{
    display:flex !important;
    flex-direction:column !important;
    height:100dvh !important;
    max-height:100dvh !important;
    overflow:hidden !important;
    padding-bottom:env(safe-area-inset-bottom) !important;
  }

  .hhv2-sidebar .hhv2-chat-list,
  .hhv2-sidebar .hhv2-recent,
  .hhv2-sidebar .hhv2-history{
    min-height:0 !important;
    flex:1 1 auto !important;
    overflow-y:auto !important;
    overscroll-behavior:contain !important;
    padding-bottom:12px !important;
  }

  .hhv2-account{
    position:sticky !important;
    bottom:0 !important;
    left:0 !important;
    right:0 !important;
    flex:0 0 auto !important;
    width:100% !important;
    margin-top:auto !important;
    padding:10px 12px calc(12px + env(safe-area-inset-bottom)) !important;
    background:var(--hhv2-sidebar-bg,#0b0e19) !important;
    border-top:1px solid rgba(255,255,255,.10) !important;
    z-index:6 !important;
  }

  html[data-hhv2-theme="light"] .hhv2-account{
    background:#ffffff !important;
    border-top-color:#dbe3ef !important;
  }

  .hhv2-account-info{
    min-width:0 !important;
    flex:1 1 auto !important;
  }

  .hhv2-account-actions{
    display:flex !important;
    flex-wrap:wrap !important;
    justify-content:flex-end !important;
    gap:5px !important;
    max-width:55% !important;
  }

  .hhv2-account-btn{
    min-height:32px !important;
    padding:0 8px !important;
    font-size:10px !important;
  }
}


/* v1.8.3 mobile sidebar must sit above the fixed composer */
@media (max-width:820px){
  .hhv2-sidebar{z-index:120 !important;}
  .hhv2-overlay{z-index:110 !important;}
  .hhv2-root.is-sidebar-open .hhv2-composer-wrap{pointer-events:none !important;}
}


/* v1.8.4 mobile account footer polish */
@media (max-width:760px){
  .hhv2-account{
    align-items:flex-end !important;
    gap:10px !important;
    padding:12px 12px calc(14px + env(safe-area-inset-bottom)) !important;
  }

  .hhv2-account-info{
    display:flex !important;
    flex-direction:column !important;
    align-items:flex-start !important;
    justify-content:flex-end !important;
    gap:6px !important;
    min-width:0 !important;
  }

  .hhv2-account-name{
    max-width:100% !important;
    font-size:12px !important;
    font-weight:700 !important;
    color:var(--hhv2-text) !important;
  }

  .hhv2-credit{
    display:inline-flex !important;
    align-items:center !important;
    padding:4px 8px !important;
    border-radius:999px !important;
    background:rgba(93,101,255,.14) !important;
    color:#dfe6ff !important;
    font-size:11px !important;
    font-weight:800 !important;
    line-height:1 !important;
  }

  .hhv2-account-actions{
    flex:0 0 112px !important;
    width:112px !important;
    display:flex !important;
    flex-direction:column !important;
    align-items:stretch !important;
    gap:8px !important;
    max-width:none !important;
  }

  .hhv2-account-btn{
    width:100% !important;
    min-height:36px !important;
    padding:0 12px !important;
    border-radius:12px !important;
    border:1px solid rgba(255,255,255,.10) !important;
    background:rgba(255,255,255,.06) !important;
    color:#eef2ff !important;
    font-size:12px !important;
    font-weight:800 !important;
    box-shadow:0 6px 16px rgba(0,0,0,.16) !important;
  }

  .hhv2-account-btn:hover,
  .hhv2-account-btn:active{
    background:rgba(255,255,255,.10) !important;
    border-color:rgba(255,255,255,.18) !important;
    color:#ffffff !important;
  }

  html[data-hhv2-theme="light"] .hhv2-account-name{color:#172033 !important;}
  html[data-hhv2-theme="light"] .hhv2-credit{
    background:#e8f7ef !important;
    color:#16734e !important;
  }
  html[data-hhv2-theme="light"] .hhv2-account-btn{
    border-color:#d9e2ee !important;
    background:#ffffff !important;
    color:#263348 !important;
    box-shadow:0 6px 14px rgba(19,35,67,.08) !important;
  }
  html[data-hhv2-theme="light"] .hhv2-account-btn:hover,
  html[data-hhv2-theme="light"] .hhv2-account-btn:active{
    background:#f4f7fb !important;
    border-color:#c7d3e4 !important;
    color:#0f172a !important;
  }
}

/* v1.8.5 installable HEYHEY app */
.hhv2-install-btn[hidden]{
  display:none !important;
}

@media (display-mode:standalone){
  body{
    overscroll-behavior:none;
  }

  .hhv2-root{
    min-height:100dvh;
  }
}

@media (max-width:760px){
  .hhv2-install-btn{
    border-color:rgba(73,184,239,.30) !important;
  }

  html[data-hhv2-theme="light"] .hhv2-install-btn{
    background:#eef6ff !important;
    border-color:#c5daf4 !important;
    color:#2458a8 !important;
  }
}
