/* Shared refinements; desktop and touch layouts use the same controls. */
:root{--imv-ink:#193b49;--imv-muted:#536b79;--imv-line:#dce6eb;--imv-dark-button:#0f172a;--imv-dark-button-hover:#1e293b;--imv-type-small:12px;--imv-type-body:13px;--imv-type-label:13px;--imv-type-section:16px;--imv-type-window:14px;--imv-space-1:4px;--imv-space-2:8px;--imv-space-3:12px;--imv-space-4:16px;--imv-space-5:24px;--imv-control-radius:10px;--imv-control-height:40px;--imv-secondary-bg:#f1f5f8;--imv-secondary-hover:#e5edf2;--imv-danger:#b42318;--imv-danger-bg:#fff1f0}
:where(.drawer-view,.scanner-modal-content,.cabinet-content) :is(input,select,textarea){font-size:max(14px,1em)}
:where(.drawer-view,.scanner-modal-content,.cabinet-content) :is(p,label,summary){line-height:1.55}
:where(.drawer-view,.scanner-modal-content) :is(small,.text-muted){color:var(--imv-muted)}
:where(button,a,input,select,textarea,summary):focus-visible{outline:3px solid #008dbb;outline-offset:3px}
.imv-field-label{display:block;font-size:14px;font-weight:600;color:var(--imv-ink);margin:12px 0 6px}
.imv-forgot{display:block;text-align:center;margin:6px 0 0;padding:5px;color:#087fa6;font-size:14px}
.apple-auth-options-row:has(.imv-forgot),#form-auth-login .form-group:has(#login-remember-me){display:flex;align-items:center;justify-content:space-between;gap:12px}
.apple-auth-options-row .imv-forgot,#form-auth-login .form-group .imv-forgot{display:inline-block;flex:none;margin:0;padding:2px 0;text-align:right;font-size:12px}
#form-auth-login .form-group:has(#login-remember-me) label{flex:1}
.imv-reset-hidden{display:none!important}
.imv-reset-panel{padding:8px 0 0;color:var(--imv-ink)}
.imv-reset-panel h3{margin:0 0 8px;font-size:18px}
.imv-reset-panel p{margin:0 0 14px;font-size:14px;line-height:1.45}
.imv-reset-panel label{display:block;margin:0 0 6px;font-size:14px;font-weight:600}
.imv-reset-panel input{display:block;box-sizing:border-box;width:100%;height:46px;margin:0 0 12px;padding:10px 12px;border:1px solid #dce6eb;border-radius:10px;background:#f8fafc;color:var(--imv-ink);font:inherit}
.imv-reset-panel button{min-height:44px;border-radius:10px;font:inherit;cursor:pointer}
.imv-reset-submit{width:100%;border:0;background:var(--imv-dark-button);color:white;font-weight:600}
.imv-reset-submit:disabled{opacity:.6}
.imv-reset-back{display:block;margin:8px auto 0;padding:4px 10px;border:0;background:none;color:#087fa6}
.imv-reset-status{margin:10px 0 0!important;overflow-wrap:anywhere}
.imv-reset-status.is-error{color:#b42335}
.imv-field-error{display:block;color:#b42335;font-size:13px;line-height:1.5;margin:5px 0 9px}
[aria-invalid=true]{border-color:#b42335!important}
.imv-chat-status{flex-basis:100%;font-size:13px;color:var(--imv-muted);line-height:1.5}
.imv-chat-status:empty{display:none}
.imv-chat-status button{margin:4px 8px;min-height:40px;border:1px solid var(--imv-line);border-radius:10px;background:#fff;padding:8px 12px;color:var(--imv-ink)}
#chat-composer-form,#drawer-chat-composer{flex-wrap:wrap;align-items:flex-end}
#chat-message-input,#drawer-chat-input{min-width:0;min-height:44px;max-height:120px;resize:none;font:inherit;line-height:1.5;white-space:pre-wrap;padding:10px 12px;box-sizing:border-box}
.imv-chat-attachment{display:flex;align-items:center;gap:10px;flex:1 0 100%;padding:8px;border:1px solid var(--imv-line);border-radius:12px;background:#f4f8fa}
.imv-chat-attachment img{width:72px;height:64px;object-fit:cover;border-radius:8px}
.imv-chat-attachment span{flex:1;font-size:13px}
.imv-chat-attachment button{min-height:44px;border:0;border-radius:10px;background:#fff;padding:8px 12px;color:#a52738}
.imv-chat-new{position:sticky;bottom:8px;display:block;z-index:2;margin:6px auto;padding:10px 16px;min-height:44px;background:var(--imv-dark-button);color:#fff;border:0;border-radius:22px;box-shadow:0 3px 12px #193b4926}
.imv-edit-review{border:0;border-radius:8px;background:#edf6fa;color:#087fa6;min-height:40px;padding:8px 12px;justify-self:end}
.imv-prefilled-review,.imv-resume-draft{width:100%;min-height:44px;padding:10px 14px;border:1px solid #c9e2ec;border-radius:12px;background:#eef8fc;color:#193b49;margin:8px 0;font:inherit}
.imv-copy-code{border:0;background:transparent;color:#087fa6;padding:7px;min-height:36px;font-size:12px;border-radius:8px}
.mission-compact-heading{flex-wrap:wrap;gap:5px!important}
.mission-compact-heading :is(h4,h5,.drawer-mission-place-row){flex:1 1 55%}
.imv-mission-next{margin:8px 0;font-size:13px;line-height:1.5;color:#47606e}
.imv-mission-date-group{font-size:13px;line-height:1.5;color:var(--imv-muted);margin:18px 0 8px;font-weight:600}
.imv-active-filters{display:flex;flex-wrap:wrap;gap:6px;padding:8px 14px}
.imv-active-filters button{border:1px solid #cee1e9;background:#f0f8fb;border-radius:18px;padding:7px 10px;color:var(--imv-ink);font-size:13px;min-height:36px}
.imv-map-area-actions{position:absolute;top:18px;left:50%;transform:translateX(-50%);display:flex;flex-wrap:wrap;justify-content:center;gap:4px;z-index:5;max-width:calc(100% - 28px);pointer-events:none}
.imv-map-area-actions button,.imv-location-status{pointer-events:auto;box-sizing:border-box;border:1px solid rgba(255,255,255,.65);background:rgba(246,251,253,.28);border-radius:16px;box-shadow:0 3px 10px rgba(25,59,73,.1),inset 0 1px 0 rgba(255,255,255,.72);-webkit-backdrop-filter:blur(10px) saturate(150%);backdrop-filter:blur(10px) saturate(150%);color:var(--imv-ink);font:inherit;font-size:11px;line-height:1.2;min-height:28px;padding:5px 9px;white-space:nowrap}
.imv-location-status{flex:0 0 auto;text-align:center}
body.dark-theme .imv-map-area-actions button,body.dark-theme .imv-location-status{border-color:rgba(223,239,248,.22);background:rgba(31,45,56,.38);color:#e2edf3;box-shadow:0 3px 10px rgba(0,0,0,.16)}
.imv-tour-save-state{font-size:12px;color:#79561b;margin:3px 0 0}
.imv-tour-save-state.is-saved{color:#12805c}
.imv-day-map-tools{display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin:8px 0 12px;font-size:13px}
.imv-day-map-tools button{min-height:44px;padding:9px 12px;border:1px solid var(--imv-line);background:#fff;border-radius:10px;color:var(--imv-ink)}
.imv-day-map-tools button[aria-pressed=true]{background:var(--imv-ink);color:#fff}
.tm-tour-stop-actions [data-tour-drag]{touch-action:none;cursor:grab;color:#56717f;font-size:20px}
.tm-tour-stop-card.is-dragging{position:relative;z-index:8;box-shadow:0 8px 26px #193b4933;will-change:transform;background:white}
.tm-tour-stop-card.is-drop-target{outline:2px dashed #008dbb;outline-offset:2px}
.imv-notice-history{margin:0 10px 12px 38px;border-left:2px solid #e4edf1;padding-left:8px}
.imv-notice-history summary{font-size:13px;color:var(--imv-muted);cursor:pointer;padding:9px 8px;min-height:40px;box-sizing:border-box}
.imv-notice-history .imv-notice-item{font-size:13px}
:is(.imv-resume-draft,.imv-map-area-actions,.imv-map-area-actions button,.imv-location-status,.imv-active-filters)[hidden]{display:none!important}
/* Filled dark actions use the same navy as the sign-in button. */
:is(.apple-auth-submit-btn,.drawer-btn-primary,.drawer-primary-btn,.drawer-primary-button,.scanner-btn-primary,.outing-app .outing-button.primary,.imv-reset-submit,.imv-chat-new,.tm-tour-entry,.tm-journey .tm-tour-generator .tm-suggest-tour,.tm-journey .tm-stops-toggle,.tm-tour-detail-actions>button:first-child,.tm-journey .tm-tour-footer-buttons>button:is([data-tour-action=save],[data-tour-action=review-save]),.mission-compact .mission-compact-partner>.mission-compact-chat,.mission-compact .mission-compact-partner>.mission-compact-place-review):not(:disabled){background:var(--imv-dark-button)!important;border-color:var(--imv-dark-button)!important;color:#fff!important}
:is(.apple-auth-submit-btn,.drawer-btn-primary,.drawer-primary-btn,.drawer-primary-button,.scanner-btn-primary,.outing-app .outing-button.primary,.imv-reset-submit,.imv-chat-new,.tm-tour-entry,.tm-journey .tm-tour-generator .tm-suggest-tour,.tm-journey .tm-stops-toggle,.tm-tour-detail-actions>button:first-child,.tm-journey .tm-tour-footer-buttons>button:is([data-tour-action=save],[data-tour-action=review-save]),.mission-compact .mission-compact-partner>.mission-compact-chat,.mission-compact .mission-compact-partner>.mission-compact-place-review):not(:disabled):hover{background:var(--imv-dark-button-hover)!important;border-color:var(--imv-dark-button-hover)!important}
@media(min-width:769px) and (max-width:1200px){body{--imv-rail-width:216px}body:has(.apple-desktop-rail.collapsed),body:has(.desktop-left-column.rail-collapsed){--imv-rail-width:68px}body .desktop-left-column{max-width:max(280px,calc(100vw - var(--imv-rail-width) - 300px))!important}body .desktop-left-column.places-expanded{width:min(560px,calc(100vw - var(--imv-rail-width) - 300px))!important;min-width:280px!important}}
@media(max-width:768px){
 #auth-modal.mobile-auth-shared>.scanner-modal-content{height:auto!important;overflow-y:auto!important}
 #auth-modal.mobile-auth-shared #drawer-view-auth{display:block!important;flex:none;min-height:0}
 #auth-modal.mobile-auth-shared #drawer-view-auth .drawer-view-scroll{display:block;overflow:visible!important}
 #auth-modal.mobile-auth-shared #drawer-view-auth .apple-auth-submit-btn{position:sticky;bottom:0;z-index:2;background:#0f172a}
 :where(.drawer-view,.scanner-modal-content,.cabinet-content) :is(p,label,summary){font-size:14px}
 :where(.drawer-view,.scanner-modal-content) :is(input,select,textarea){font-size:16px}
 :where(.drawer-view,.scanner-modal-content) :is(button,summary){min-height:44px}
 .mission-compact-chat,.mission-compact-place-review{min-height:44px!important}
 .imv-map-area-actions{top:calc(var(--mobile-header-bottom,150px) + 8px);max-width:calc(100% - 24px)}
}
@media(max-height:540px) and (orientation:landscape){
 .scanner-modal-content{max-height:calc(100dvh - 16px)!important}
 .tm-tour-sticky-actions{padding:7px 12px!important}.tm-tour-footer-summary{display:none!important}
 .tm-planning-steps{padding-block:4px!important}
 .imv-map-area-actions{top:8px;left:70%;max-width:45%}
}
@media(prefers-reduced-motion:reduce){.scanner-modal-overlay,.modal-overlay,.tm-tour-stop-card{transition:none!important;animation:none!important}}

@media(prefers-reduced-motion:no-preference){.scanner-modal-overlay.active>.scanner-modal-content{animation:imv-dialog-in .16s ease-out}@keyframes imv-dialog-in{from{opacity:.6;transform:translateY(5px)}to{opacity:1;transform:translateY(0)}}}

.imv-copy-code{width:36px;flex:0 0 36px;display:inline-grid;place-items:center}.imv-copy-code svg{width:17px;height:17px}

/* Shared action hierarchy. Use imv-btn + a semantic variant for new controls. */
html body :is(.imv-btn,.apple-auth-submit-btn,.scanner-btn-primary,.drawer-btn-primary,.drawer-primary-btn,.drawer-primary-button,.drawer-btn-secondary,.scanner-btn-secondary,.btn-action-secondary,.drawer-btn-danger){
  min-height:var(--imv-control-height);padding:10px 14px;border-radius:var(--imv-control-radius)!important;
  font-family:var(--font-firago),sans-serif;font-size:var(--imv-type-body)!important;font-weight:500!important;line-height:1.4;
  box-sizing:border-box;box-shadow:none;cursor:pointer;
}
html body :is(.imv-btn-primary,.apple-auth-submit-btn,.scanner-btn-primary,.drawer-btn-primary,.drawer-primary-btn,.drawer-primary-button):not(:disabled){
  background:var(--imv-dark-button)!important;border:1px solid var(--imv-dark-button)!important;color:#fff!important;
}
html body :is(.imv-btn-primary,.apple-auth-submit-btn,.scanner-btn-primary,.drawer-btn-primary,.drawer-primary-btn,.drawer-primary-button):not(:disabled):hover{background:var(--imv-dark-button-hover)!important}
html body :is(.imv-btn-secondary,.drawer-btn-secondary,.scanner-btn-secondary,.btn-action-secondary,.tm-tour-detail-actions>button:not(:first-child),.tm-tour-footer-buttons>button[data-tour-action=route],.tm-tour-footer-buttons>button[data-tour-action=request]):not(:disabled){
  background:var(--imv-secondary-bg)!important;border:1px solid var(--imv-line)!important;color:var(--imv-ink)!important;
}
html body :is(.imv-btn-secondary,.drawer-btn-secondary,.scanner-btn-secondary,.btn-action-secondary,.tm-tour-detail-actions>button:not(:first-child),.tm-tour-footer-buttons>button[data-tour-action=route],.tm-tour-footer-buttons>button[data-tour-action=request]):not(:disabled):hover{background:var(--imv-secondary-hover)!important}
html body :is(.imv-btn-danger,.drawer-btn-danger):not(:disabled){background:var(--imv-danger-bg)!important;border:1px solid var(--imv-danger)!important;color:var(--imv-danger)!important}
html body :is(.imv-btn,.apple-auth-submit-btn,.scanner-btn-primary,.drawer-btn-primary,.drawer-primary-btn,.drawer-primary-button,.drawer-btn-secondary,.scanner-btn-secondary,.btn-action-secondary,.drawer-btn-danger):disabled{opacity:.5;cursor:default}
/* Named text and form styles leave map labels, compact cards and navigation controls intact. */
html body :is(.imv-section-title,.drawer-section-title,.cabinet-section-title){font-size:var(--imv-type-section)!important;font-weight:600;line-height:1.5;margin-block:0 var(--imv-space-3)}
html body :is(.imv-description,.drawer-description,.scanner-description){font-size:var(--imv-type-body);line-height:1.65;color:var(--imv-muted)}
html body :is(.imv-help,.form-help,.drawer-form-hint){font-size:var(--imv-type-small);line-height:1.6;color:var(--imv-muted);margin-top:var(--imv-space-2)}
html body :is(.imv-field-label,.drawer-form-label,.scanner-form-label){font-size:var(--imv-type-label)!important;font-weight:500;line-height:1.5;margin-bottom:var(--imv-space-2)}
html body :is(.imv-input,.drawer-form-input,.drawer-form-select,.scanner-input){min-height:var(--imv-control-height);border-radius:var(--imv-control-radius)!important;font-size:14px!important;line-height:1.5;box-sizing:border-box}
html body :is(.imv-field,.drawer-form-group,.scanner-form-group){margin-bottom:var(--imv-space-4)}
html body :is(.scanner-title,.modal-title){font-size:var(--imv-type-window)!important;font-weight:600!important;line-height:1.5}
body.dark-theme{--imv-ink:#d8e9ef;--imv-muted:#b6c6d0;--imv-line:#3b4d5d;--imv-secondary-bg:#273746;--imv-secondary-hover:#34495a;--imv-danger:#ffb4ab;--imv-danger-bg:#442927}
@media(max-width:768px){
  :root{--imv-type-window:13px}
  html body :is(.imv-input,.drawer-form-input,.drawer-form-select,.scanner-input){font-size:16px!important}
}

/* Reserve the vertical scrollbar track before content grows or disclosures open. */
:where(.drawer-view-scroll,.places-list,.place-details-layout,.tm-integrated-results,.tm-integrated-detail,.tm-journey,.drawer-chat-messages-body,.chat-messages,.scanner-body,#public-person-content,#drawer-view-auth,#filters-dropdown){scrollbar-gutter:stable}
