/* Mobile implementation of the user's “Relay Apply Mobile Redesign” in Stitch.
   Scoped away from the existing floating navigation and printable A4 themes. */
:root {
  --mobile-ui-scale: .60;
  --stitch-surface: #0f131c;
  --stitch-low: #181c24;
  --stitch-card: #1c2028;
  --stitch-high: #262a33;
  --stitch-primary: #8083ff;
  --stitch-cyan: #7bd0ff;
  --stitch-green: #4edea3;
  --stitch-text: #dfe2ee;
  --stitch-muted: #a8a8bc;
}
/* All bottom anchors use the same full-height shell, including iOS standalone.
   The existing dock appearance and dimensions are unchanged. */
#mobile-bottom-dock-wrapper {
  top: calc(var(--mobile-shell-height) - var(--safe-bottom) - 8px - 58px) !important;
  bottom: auto !important;
}
#mobile-bottom-fade-scrim {
  top: calc(var(--mobile-shell-height) - var(--mobile-dock-clearance)) !important;
  bottom: auto !important;
}
#app-layout > main, body > [id^="modal-"]:not(#modal-auth),
#mobile-studio-drawer, #map-mobile-drawer, #stitch-job-filter-drawer {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--stitch-text);
}
#app-layout > main, #main-view-container > section,
#view-jobs #job-subview-kanban { background: var(--stitch-surface) !important; }
#app-layout #command-header {
  zoom: var(--mobile-ui-scale) !important;
  width: 100% !important;
  background: rgba(15,19,28,.96) !important;
  box-shadow: 0 3px 14px #0002;
  padding: calc(8px + var(--safe-top) / var(--mobile-ui-scale)) 14px 8px !important;
  gap: 10px !important;
  min-height: calc(60px + var(--safe-top) / var(--mobile-ui-scale)) !important;
}
#app-layout #command-header > div:first-child { gap: 10px !important; }
#app-layout #command-header button[onclick="toggleMobileSidebar(true)"] {
  width: 32px !important; min-width: 32px !important; height: 44px !important;
  background: none !important; border: 0 !important; border-radius: 8px !important;
}
#app-layout #command-header button[onclick="toggleMobileSidebar(true)"] img { width: 28px; height: 28px; }
#app-layout #page-title { font-size: 20px !important; font-weight: 650; line-height: 23px; }
#stitch-header-context { font-size: 17px; color: var(--stitch-muted); line-height: 20px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block !important; }
#app-layout #command-header #btn-automation-toggle {
  width: auto !important; min-width: 74px !important; height: 34px !important;
  min-height: 34px !important; border-radius: 20px !important; padding: 0 9px !important;
  font-size: 10px !important; gap: 5px !important; border: 1px solid #4edea330 !important;
  background: #4edea310 !important; color: var(--stitch-green) !important;
}
#app-layout #command-header #btn-automation-toggle[data-paused="true"] { background: #fbbf2410 !important; color: #fbbf24 !important; border-color: #fbbf2430 !important; }
#app-layout #command-header #btn-automation-toggle svg { width: 14px; height: 14px; }
#app-layout #command-header #automation-toggle-label { display: none !important; }
#stitch-automation-state { font-size: 16px; font-weight: 650; }
#app-layout #command-header #stitch-automation-state { display: flex !important; }
#app-layout #command-header .stitch-avatar-initials { display: grid !important; }
#app-layout #command-header > div:first-child > div > div:first-child > span { display: none !important; }
#app-layout #command-header button[onclick="openProfileWizard()"] { width: 34px !important; min-width: 34px !important; min-height: 44px !important; background: none !important; border: 0 !important; }
#app-layout #command-header button[onclick="openProfileWizard()"] img,
.stitch-avatar-initials { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; border: 1px solid #8083ff50; }
.stitch-avatar-initials { display: grid; place-items: center; color: #c0c1ff; background: #262a33; font-size: 11px; }

/* Search, dynamic role pills and pipeline stage pills mirror the Stitch board. */
#view-jobs #jobs-mobile-toolbar { display: none !important; }
#view-jobs #stitch-job-filters {
  padding: 12px 18px 10px !important; gap: 10px !important;
  background: var(--stitch-surface) !important;
}
#view-jobs #stitch-job-search-row { display: flex !important; gap: 8px !important; width: 100% !important; flex: 0 0 auto !important; }
#view-jobs #stitch-job-search-row > div:first-child { flex: 1 1 0 !important; width: auto !important; min-width: 0 !important; height: 56px !important; background: var(--stitch-high) !important; border-radius: 12px !important; }
#view-jobs #stitch-job-search-row > div:nth-child(2) { display: none !important; }
#view-jobs #pipe-search-input { height: 56px !important; min-height: 56px !important; font-size: 18px !important; color: var(--stitch-text); background: var(--stitch-high) !important; }
#stitch-job-filter-toggle { flex: 0 0 56px; width: 56px; height: 56px; align-items: center; justify-content: center; border-radius: 12px; background: var(--stitch-high); color: #c7c4d7; }
#stitch-job-filter-toggle svg { width: 22px; height: 22px; }
#view-jobs #stitch-job-role-row { height: auto !important; flex: 0 0 auto !important; }
#view-jobs #pipeline-track-filters { gap: 8px !important; border: 0 !important; padding: 0 !important; }
#view-jobs #pipeline-track-filters .pipe-track-btn { height: 40px !important; min-height: 40px !important; padding: 0 15px !important; font-size: 15px !important; font-weight: 550; background: var(--stitch-high) !important; color: #c7c4d7 !important; border-radius: 24px !important; }
#view-jobs #pipeline-track-filters .pipe-track-btn:not(.text-slate-400) { background: var(--stitch-primary) !important; color: #100c44 !important; }
#view-jobs .mobile-pipeline-stages { padding: 0 18px 12px; gap: 8px; border: 0; }
#view-jobs .mobile-pipeline-stages button { flex: 0 0 auto; min-height: 44px; padding: 0 13px; border: 0; border-radius: 12px; color: #c7c4d7; background: var(--stitch-low); font-size: 14px; gap: 8px; }
#view-jobs .mobile-pipeline-stages button[aria-selected="true"] { color: #00354a; background: #00a6e0; }
.stitch-stage-count { min-width: 24px; padding: 2px 5px; border-radius: 6px; font-size: 11px !important; color: inherit !important; background: #ffffff14; text-align: center; }
#stitch-workspace-status { flex: 0 0 auto; flex-direction: column; gap: 10px; margin: 0 18px 8px; padding: 13px; background: var(--stitch-card); border-radius: 14px; box-shadow: 0 4px 12px #0001; }
.stitch-status-heading { display: flex; align-items: center; gap: 10px; }
.stitch-status-heading > svg { width: 28px; height: 28px; padding: 5px; box-sizing: content-box; border-radius: 50%; background: #4edea320; color: var(--stitch-green); }
.stitch-status-heading > div { flex: 1; min-width: 0; }
.stitch-status-heading strong { font-size: 14px; font-weight: 650; }
.stitch-status-heading p { margin-top: 3px; font-size: 12px; color: var(--stitch-muted); }
.stitch-status-heading > button { min-height: 44px; min-width: 44px; display: flex; align-items: center; justify-content: center; background: var(--stitch-high); border-radius: 9px; color: var(--stitch-green); }
.stitch-status-heading > button svg { width: 16px; height: 16px; }
.stitch-status-activity { display: flex; align-items: center; justify-content: space-between; gap: 8px; border-radius: 8px; padding: 6px 9px; background: var(--stitch-low); }
#stitch-status-activity-text { font-size: 12px; line-height: 1.4; color: #c7c4d7; }
#stitch-workspace-status #btn-trigger-scan { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 10px; background: var(--stitch-high); border: 0; box-shadow: none; border-radius: 7px; color: var(--stitch-cyan); font-size: 12px; flex-shrink: 0; }
#stitch-workspace-status #btn-trigger-scan span { display: inline !important; }
#stitch-workspace-status #btn-trigger-scan svg { width: 14px; height: 14px; }
#view-jobs #job-subview-kanban .kanban-columns-container { padding: 0 18px calc(var(--mobile-dock-clearance) / var(--mobile-ui-scale)) !important; }
#view-jobs #job-subview-kanban .kanban-column > div:first-child { border: 0 !important; margin-bottom: 8px !important; padding: 4px 1px !important; }
#view-jobs #job-subview-kanban .kanban-column > div:first-child span { font-size: 14px; }
#view-jobs #job-subview-kanban .kanban-column > div:first-child [id^="pipeline-count"] { font-size: 11px; padding: 2px 7px; border-radius: 20px; }
#view-jobs #job-subview-kanban .kanban-column [id^="col-"] > .stitch-job-card {
  padding: 16px !important; border: 0 !important; border-radius: 16px !important;
  background: var(--stitch-card) !important; box-shadow: 0 4px 14px #0001 !important;
  display: flex; flex-direction: column; gap: 12px; margin-bottom: 12px;
}
.stitch-job-heading { display: flex; align-items: flex-start; gap: 10px; }
.stitch-company-avatar { width: 42px; height: 42px; flex: 0 0 42px; display: grid; place-items: center; background: #31353e; border-radius: 10px; font-size: 14px; font-weight: 700; color: #c0c1ff; }
.stitch-job-identity { flex: 1; min-width: 0; }
#view-jobs #job-subview-kanban .stitch-job-card h5 { color: var(--stitch-text); font-size: 16px !important; line-height: 1.4; font-weight: 650; white-space: normal; }
.stitch-job-identity p { font-size: 12px; color: var(--stitch-muted); line-height: 1.5; margin-top: 2px; }
.stitch-job-identity p span { color: var(--stitch-cyan); }
.stitch-match { display: flex; align-items: center; gap: 3px; font-size: 11px; white-space: nowrap; font-weight: 650; color: #fbbf24; background: #fbbf2412; padding: 5px 7px; border-radius: 20px; }
.stitch-match.high { color: var(--stitch-green); background: #4edea312; }
.stitch-match svg { width: 13px; height: 13px; }
.stitch-job-meta { display: flex; flex-wrap: wrap; gap: 5px; }
.stitch-job-meta > span { display: flex; align-items: center; gap: 5px; max-width: 100%; padding: 5px 8px; font-size: 11px; line-height: 1.4; color: #c7c4d7; background: var(--stitch-high); border-radius: 7px; }
.stitch-job-meta > span:last-child { color: var(--stitch-green); }
.stitch-job-meta svg { flex: 0 0 13px; width: 13px; height: 13px; }
.stitch-job-note { display: flex; align-items: center; gap: 8px; padding: 9px; border-radius: 10px; background: var(--stitch-low); color: #c7c4d7; font-size: 12px; line-height: 1.5; }
.stitch-job-note svg { width: 17px; height: 17px; flex-shrink: 0; color: var(--stitch-cyan); }
.stitch-job-card.needs-details .stitch-job-note { color: #ffb4ab; background: #93000a18; }
.stitch-job-card.needs-details .stitch-job-note svg { color: #ffb4ab; }
.stitch-job-actions { display: flex; gap: 8px; }
.stitch-job-actions button { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 48px; padding: 4px 8px; border-radius: 10px; background: var(--stitch-high); font-size: 13px; color: var(--stitch-text); }
.stitch-job-actions svg { width: 16px; height: 16px; }
.stitch-primary, .stitch-job-actions .stitch-primary { background: var(--stitch-primary); color: #100c44; }

/* Existing filter controls, shown as a real mobile drawer. */
#stitch-job-filter-drawer { z-index: 10045 !important; }
#stitch-job-filter-drawer .mobile-bottom-sheet { background: var(--stitch-low) !important; padding: 16px 20px calc(20px + var(--safe-bottom)) !important; }
.stitch-filter-heading { display: flex; align-items: center; justify-content: space-between; }
.stitch-filter-heading h3 { font-size: 17px; font-weight: 650; }
.stitch-filter-heading button { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--stitch-high); }
.stitch-filter-heading svg { width: 18px; height: 18px; }
#stitch-job-filter-drawer label { font-size: 13px; color: #c7c4d7; }
#stitch-job-filter-drawer #pipe-filter-min-score { width: 100% !important; height: 48px !important; min-height: 48px !important; max-width: none !important; font-size: 16px !important; padding: 0 12px !important; background: var(--stitch-high) !important; border-radius: 12px !important; color: var(--stitch-text) !important; text-align: left !important; }
#stitch-job-filter-drawer p { color: var(--stitch-muted); font-size: 13px; line-height: 1.6; }
#stitch-job-filter-drawer .stitch-primary { min-height: 48px; border-radius: 12px; font-size: 14px; font-weight: 650; }
.stitch-filters-open #mobile-bottom-dock-wrapper, .stitch-filters-open #mobile-bottom-fade-scrim { display: none !important; }

/* Document-first studio screens retain the user's actual PDF design. */
#view-cvs #cv-studio-toolbar, #view-cover-letters #letter-studio-toolbar { background: var(--stitch-surface) !important; padding: 8px 18px !important; }
#view-cvs #cv-active-select, #view-cover-letters #cl-active-select { background: var(--stitch-high) !important; color: var(--stitch-text); font-size: 17px !important; border-radius: 10px !important; }
#view-cvs #cv-studio-toolbar button[onclick="printCvToPdf()"],
#view-cover-letters #letter-studio-toolbar button[onclick="printCoverLetterToPdf()"] { background: var(--stitch-primary) !important; color: #100c44 !important; border-radius: 10px !important; }
.stitch-document-info { flex: 0 0 auto; justify-content: space-between; align-items: center; gap: 8px; padding: 0 20px 10px; font-size: 11px; color: #c7c4d7; }
.stitch-document-info > span:first-child { display: flex; gap: 5px; align-items: center; color: var(--stitch-green); min-width: 0; }
.stitch-document-info b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stitch-document-info svg { width: 13px; height: 13px; flex-shrink: 0; }
#view-cvs #cv-preview-stage, #view-cover-letters #letter-preview-stage { background: #0a0e16 !important; padding: 12px 18px !important; }
.stitch-document-style { flex: 0 0 auto; align-items: center; justify-content: space-between; gap: 8px; margin: 10px 18px 0; padding: 6px 12px; border-radius: 24px; background: var(--stitch-high); }
.stitch-document-style > button { display: flex; align-items: center; gap: 6px; min-height: 40px; min-width: 0; font-size: 13px; color: var(--stitch-text); }
.stitch-document-style > button span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stitch-document-style svg { width: 17px; height: 17px; color: #c0c1ff; flex-shrink: 0; }
.stitch-document-style > div { display: flex; gap: 6px; }
.stitch-document-style [data-accent] { width: 28px !important; height: 28px !important; min-width: 28px !important; min-height: 28px !important; max-width: 28px !important; max-height: 28px !important; flex: 0 0 28px; padding: 0 !important; aspect-ratio: 1; border-radius: 50% !important; background: var(--swatch); border: 2px solid #ffffff25; }
#view-cvs .mobile-studio-actions, #view-cover-letters .mobile-studio-actions { background: var(--stitch-surface); padding: 10px 18px calc(var(--mobile-dock-clearance) / var(--mobile-ui-scale)); gap: 6px; }
#view-cvs .mobile-studio-actions button, #view-cover-letters .mobile-studio-actions button { background: var(--stitch-low); color: #c7c4d7; font-size: 13px; min-height: 50px; border-radius: 10px; }
#view-cvs .mobile-studio-actions button:first-child, #view-cover-letters .mobile-studio-actions button:first-child { background: var(--stitch-high); color: var(--stitch-text); }
#view-cover-letters .mobile-studio-actions [data-letter-new] { flex: 0 0 44px; font-size: 11px; }
#view-cvs .mobile-studio-actions [data-fit], #view-cover-letters .mobile-studio-actions [data-fit] { flex: 0 0 40px; }
#view-cvs .mobile-studio-actions svg, #view-cover-letters .mobile-studio-actions svg { width: 18px !important; height: 18px !important; color: #c0c1ff; }
.mobile-studio-open .stitch-document-style { visibility: hidden; }
#mobile-studio-drawer { background: var(--stitch-low); border-radius: 24px 24px 0 0; box-shadow: 0 -15px 60px #0007; }
#mobile-studio-drawer .studio-drawer-head { background: var(--stitch-low); }
#mobile-studio-drawer .studio-drawer-tabs button[aria-selected="true"] { background: var(--stitch-primary); color: #100c44; }
#mobile-studio-drawer .studio-drawer-heading button { background: var(--stitch-high); color: #c0c1ff; }
#mobile-studio-drawer #cv-block-list button, #mobile-studio-drawer .cv-tool-group > button { background: var(--stitch-card) !important; border: 0 !important; border-radius: 10px !important; }
#mobile-studio-drawer .cv-inline-editor { border: 1px solid #8083ff40; background: var(--stitch-card); }
#mobile-studio-drawer input, #mobile-studio-drawer textarea { border-color: #ffffff12; background: #10141e; }

/* Live map with the Stitch location row, legend and nearby-results preview. */
#view-map .map-floating-top-hud { top: 12px !important; left: 18px !important; right: 18px !important; flex-direction: column !important; gap: 8px; }
#stitch-map-location { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 48px; padding: 0 12px; background: #262a33f2; border-radius: 20px; color: var(--stitch-text); box-shadow: 0 4px 15px #0003; }
#stitch-map-location span { flex: 1; min-width: 0; text-align: left; font-size: 14px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
#stitch-map-location svg { width: 17px; height: 17px; color: var(--stitch-cyan); }
#view-map .map-floating-top-hud > div { background: #181c24e8 !important; padding: 3px !important; border: 0 !important; border-radius: 18px !important; gap: 4px !important; }
#view-map .map-radius-btn { min-height: 40px !important; height: 40px !important; padding: 0 12px !important; font-size: 13px !important; border-radius: 14px !important; color: #c7c4d7 !important; }
#view-map .map-radius-btn.active { background: var(--stitch-primary) !important; color: #100c44 !important; box-shadow: none !important; border: 0 !important; }
#view-map #map-role-select-mobile { min-width: 0 !important; width: clamp(100px, 30vw, 190px) !important; max-width: 190px !important; height: 40px !important; min-height: 40px !important; font-size: 13px !important; border: 0 !important; background: var(--stitch-card) !important; border-radius: 12px; }
#stitch-map-nearby { position: absolute; left: 18px; right: 18px; bottom: calc(var(--mobile-dock-clearance) / var(--mobile-ui-scale) + 8px); z-index: 450; flex-direction: column; border-radius: 18px; background: #181c24f5; padding: 9px 12px 6px; box-shadow: 0 12px 40px #0006; backdrop-filter: blur(15px); }
.stitch-nearby-heading { min-height: 42px; display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; color: var(--stitch-text); font-size: 14px; font-weight: 650; }
.stitch-nearby-heading > span { display: flex; align-items: center; gap: 5px; }
.stitch-nearby-heading > span:last-child { color: #c0c1ff; font-size: 11px; font-weight: 500; }
.stitch-nearby-heading b { font-size: 10px; font-weight: 550; color: #a8a8bc; }
.stitch-nearby-heading svg { width: 14px; height: 14px; }
#stitch-map-nearby-cards > button { width: 100%; display: flex; align-items: flex-start; gap: 8px; padding: 10px 0; border-top: 1px solid #ffffff08; text-align: left; }
.stitch-nearby-icon { width: 32px; height: 32px; flex: 0 0 32px; display: grid; place-items: center; border-radius: 8px; background: var(--stitch-high); color: #c0c1ff; }
.stitch-nearby-icon svg { width: 17px; height: 17px; }
.stitch-nearby-identity { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.stitch-nearby-identity strong { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stitch-nearby-identity > span, .stitch-nearby-identity small { font-size: 11px; color: var(--stitch-muted); }
.stitch-nearby-score { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; color: #c0c1ff; font-size: 12px; }
.stitch-nearby-score svg { width: 14px; height: 14px; }
.stitch-nearby-empty { font-size: 12px; color: var(--stitch-muted); padding: 10px 0; line-height: 1.5; }
#view-map .map-mobile-bottom-actions > button:first-child { display: none !important; }
#view-map .map-floating-bottom-hud { left: auto !important; right: 18px !important; bottom: calc(var(--mobile-dock-clearance) / var(--mobile-ui-scale) + 240px) !important; }
#view-map .map-mobile-recenter { background: #262a33e8 !important; border: 1px solid #ffffff12 !important; box-shadow: 0 4px 16px #0003 !important; color: var(--stitch-cyan); }
#stitch-map-legend { position: absolute; left: 18px; bottom: calc(var(--mobile-dock-clearance) / var(--mobile-ui-scale) + 244px); z-index: 400; gap: 9px; padding: 7px 10px; border-radius: 20px; background: #181c24e8; color: #c7c4d7; font-size: 10px; }
#stitch-map-legend span { display: flex; align-items: center; gap: 4px; }
#stitch-map-legend i { width: 6px; height: 6px; border-radius: 50%; background: #c0c1ff; }
#stitch-map-legend .you { background: #7bd0ff; }
#stitch-map-legend .applied { background: #4edea3; }
#map-mobile-drawer:not(.hidden) { z-index: 10040 !important; }
#map-mobile-drawer .mobile-bottom-sheet { background: var(--stitch-low) !important; }
#map-mobile-drawer #map-mobile-job-list > div { background: var(--stitch-card) !important; border: 0 !important; border-radius: 14px !important; }

/* Exact application review: real proof and real stored document artifacts. */
#modal-application-dossier > .application-dossier-shell,
#modal-application-dossier .application-dossier-shell > div { background: var(--stitch-surface); }
#modal-application-dossier .application-dossier-shell > div:nth-child(2),
#modal-profile-wizard > div > div:nth-child(2) { flex: 0 0 auto !important; overflow-y: hidden !important; }
#modal-application-dossier #stitch-review-summary { display: flex !important; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.stitch-review-quality { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--stitch-card); border-radius: 14px; padding: 12px; }
.stitch-review-quality span { display: flex; align-items: center; gap: 7px; font-size: 14px; }
.stitch-review-quality svg { width: 20px; height: 20px; color: var(--stitch-green); }
.stitch-review-quality b { font-size: 10px; color: var(--stitch-green); background: #4edea315; padding: 4px 7px; border-radius: 6px; text-transform: capitalize; }
#stitch-review-summary details { background: var(--stitch-card); padding: 10px 12px; border-radius: 14px; }
#stitch-review-summary summary { display: flex; align-items: center; gap: 7px; min-height: 32px; font-size: 13px; font-weight: 600; cursor: pointer; list-style: none; }
#stitch-review-summary summary::-webkit-details-marker { display: none; }
#stitch-review-summary summary svg { width: 15px; height: 15px; color: var(--stitch-cyan); }
#stitch-review-summary summary svg:last-child { margin-left: auto; }
#stitch-review-summary details > div { display: flex; flex-direction: column; gap: 7px; margin-top: 10px; }
#stitch-review-summary details > div > span { display: flex; justify-content: space-between; gap: 12px; font-size: 11px; color: var(--stitch-muted); }
#stitch-review-summary strong { font-weight: 550; color: var(--stitch-text); }
#stitch-review-summary details p { padding: 7px 8px; background: #4edea310; border-radius: 6px; color: var(--stitch-green); font-size: 10px; line-height: 1.5; }
#modal-application-dossier .dossier-tab { background: var(--stitch-high); border: 0; border-radius: 12px; font-size: 12px; color: #c7c4d7; }
#modal-application-dossier .dossier-tab.is-active { background: var(--stitch-primary); color: #100c44; box-shadow: none; }
#modal-application-dossier .dossier-document-toolbar { background: var(--stitch-card); border: 0; border-radius: 14px; }
#modal-application-dossier .dossier-tailoring-box { background: var(--stitch-card); border: 0; border-left: 3px solid #8083ff; border-radius: 12px; }
#modal-application-dossier .dossier-cv-preview-stage { background: var(--stitch-card); border: 0; padding: 14px; border-radius: 14px; }
#modal-application-dossier .application-dossier-shell > div:last-child { background: var(--stitch-low); border-top: 1px solid #ffffff08; }
#modal-application-dossier button[onclick="moveDossierJobToStage('interviewing')"] { background: var(--stitch-primary); color: #100c44; border: 0; }
#modal-application-dossier button[onclick="moveDossierJobToStage('offer')"] { background: var(--stitch-high); color: var(--stitch-text); border: 0; }

/* Portal wizard uses actual connection badges and the requested Coming soon gates. */
#modal-portal-credentials > div, #modal-portal-credentials > div > div { background: var(--stitch-surface); }
#modal-portal-credentials #portal-wizard-icon-grid { gap: 12px; }
#modal-portal-credentials .portal-wizard-card { background: var(--stitch-card); border: 1px solid transparent; border-radius: 14px; padding: 16px 12px; align-items: flex-start; text-align: left; gap: 9px; min-height: 136px; }
#modal-portal-credentials .portal-wizard-card.is-active { border-color: #8083ff80; box-shadow: 0 0 0 2px #8083ff12; background: var(--stitch-high); }
#modal-portal-credentials .portal-brand-logo { width: 30px; height: 30px; border-radius: 7px; padding: 3px; background: #fff; }
#modal-portal-credentials .portal-wizard-card > div { width: 100%; }
#modal-portal-credentials .portal-wizard-card span[id^="portal-session-badge"] { border-radius: 6px; font-size: 10px; max-width: 100%; white-space: normal; }
#modal-portal-credentials #portal-wizard-detail { background: var(--stitch-card); border-radius: 14px; }
#modal-portal-credentials button[onclick="savePortalCredentials()"],
#modal-cover-letter button[onclick="saveCoverLetter()"] { background: var(--stitch-primary); color: #100c44; box-shadow: none; }
#modal-portal-credentials #portal-wizard-picker > p { color: var(--stitch-muted); font-size: 13px; line-height: 1.6; }
#modal-cover-letter > div, #modal-cover-letter > div > div { background: var(--stitch-surface); }
#modal-cover-letter input, #modal-cover-letter textarea { background: var(--stitch-card); border-color: #ffffff0c; border-radius: 12px; }
/* Profile is a bounded form with a fixed tab strip and one scrollable pane. */
#modal-profile-wizard > div { background: var(--stitch-surface) !important; }
#modal-profile-wizard > div > div:first-child { padding: 8px 14px !important; background: var(--stitch-surface); }
#modal-profile-wizard > div > div:first-child p { display: none; }
#modal-profile-wizard > div > div:nth-child(2) { padding: 4px 12px !important; gap: 4px; background: var(--stitch-surface); border: 0; }
#modal-profile-wizard .profile-tab { min-height: 32px !important; height: 32px; padding: 0 10px !important; font-size: 11px; border: 0; border-radius: 9px; flex-shrink: 0; }
#modal-profile-wizard .profile-tab.active { background: var(--stitch-primary); color: #100c44; }
#modal-profile-wizard #profile-editor-panes { flex: 1 1 0 !important; min-height: 0 !important; width: 100%; overflow-y: auto !important; padding: 12px !important; background: var(--stitch-surface); }
#modal-profile-wizard #profile-editor-panes > div { min-width: 0; }
#modal-profile-wizard #profile-import-banner { background: var(--stitch-card); border: 0; border-radius: 12px; padding: 10px !important; gap: 8px; box-shadow: none; align-items: center; }
#profile-import-banner > div:first-child { flex: 1; min-width: 0; }
#profile-import-banner > div:first-child > div { flex-wrap: wrap; }
#profile-import-banner > div:first-child > div > span:first-child { font-size: 10px; letter-spacing: 0; text-transform: none; }
#profile-import-banner p, #profile-import-banner > div:first-child > div > span:last-child { display: none; }
#modal-profile-wizard #btn-upload-prof-cvs-trigger { min-height: 32px; padding: 0 10px; font-size: 10px; border-radius: 8px; box-shadow: none; background: var(--stitch-primary); color: #100c44; }
#modal-profile-wizard #btn-upload-prof-cvs-trigger svg { width: 14px; height: 14px; }
#modal-profile-wizard #ptab-identity > .grid { display: flex !important; flex-direction: column; gap: 12px; }
#modal-profile-wizard #ptab-identity > .grid > div:first-child { flex-direction: row; justify-content: flex-start; padding: 10px !important; background: var(--stitch-card); gap: 10px; text-align: left; }
#modal-profile-wizard #ptab-identity > .grid > div:first-child > div:first-child { width: 44px; height: 44px; margin: 0; flex-shrink: 0; border-radius: 50%; }
#modal-profile-wizard #ptab-identity > .grid > div:last-child { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; width: 100%; }
#modal-profile-wizard #ptab-identity .col-span-2 { grid-column: 1 / -1; }
#modal-profile-wizard label { font-size: 11px; color: #a8a8bc; line-height: 1.4; }
#modal-profile-wizard input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
#modal-profile-wizard select { height: 36px !important; min-height: 36px !important; max-width: 100%; font-size: 16px !important; padding: 4px 8px !important; background: var(--stitch-card); border-color: #ffffff0c; border-radius: 8px; }
#modal-profile-wizard textarea { font-size: 16px !important; min-height: 88px; padding: 8px !important; background: var(--stitch-card); border-color: #ffffff0c; border-radius: 8px; }
#modal-profile-wizard #ptab-identity > div:last-child { padding: 10px !important; background: var(--stitch-card); border: 0; }
#modal-profile-wizard #profile-editor-panes button { min-height: 32px; }
#modal-profile-wizard > div > div:last-child { padding: 8px 12px !important; background: var(--stitch-low); gap: 8px; }
#modal-profile-wizard > div > div:last-child button { min-height: 36px; padding: 6px 12px; font-size: 12px; box-shadow: none; }
#modal-profile-wizard .grid > div { min-width: 0; }
#view-map .map-floating-top-hud > div { flex-wrap: nowrap !important; }
#view-map .map-floating-top-hud > div > div:last-child { flex: 1; min-width: 0; }
#view-map #map-role-select-mobile { width: 100% !important; max-width: none !important; text-overflow: ellipsis; }
@media (max-width: 359px) {
  #app-layout #command-header { padding-left: 10px !important; padding-right: 10px !important; gap: 6px !important; }
  #app-layout #command-header #btn-automation-toggle { min-width: 64px !important; }
  #stitch-header-context { max-width: 130px; }
  #view-jobs #job-subview-kanban .stitch-job-card h5 { font-size: 15px !important; }
  .stitch-job-heading { gap: 7px; }
  .stitch-company-avatar { width: 34px; height: 34px; flex-basis: 34px; }
  #view-cvs .mobile-studio-actions, #view-cover-letters .mobile-studio-actions { gap: 4px; }
  #view-cvs .mobile-studio-actions button, #view-cover-letters .mobile-studio-actions button { font-size: 11px; padding: 0 4px; }
}
@media (max-height: 650px) {
  #stitch-workspace-status { margin-bottom: 4px; padding: 8px 10px; }
  .stitch-status-heading p { display: none; }
  #stitch-map-nearby-cards > button:nth-child(n+2) { display: none; }
  #view-map .map-floating-bottom-hud { bottom: calc(var(--mobile-dock-clearance) / var(--mobile-ui-scale) + 165px) !important; }
  #stitch-map-legend { bottom: calc(var(--mobile-dock-clearance) / var(--mobile-ui-scale) + 166px); }
}
/* One compact 60% scale, without typography compensation. */
/* Socials uses a 13.5px mobile root; keep rem-based app controls equally lean. */
html { font-size: 13.5px; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
#main-view-container input, #main-view-container select { font-size: 16px !important; }
#view-jobs #job-subview-kanban .stitch-job-card h5 { font-size: 12px !important; line-height: 1.3; }
.stitch-job-identity p, .stitch-job-note, .stitch-job-actions button { font-size: 10px; }
.stitch-job-meta > span, .stitch-match { font-size: 10px; }
#view-jobs .mobile-pipeline-stages button { font-size: 13px; min-height: 36px; }
.stitch-stage-count { font-size: 11px !important; }
#view-jobs #pipeline-track-filters .pipe-track-btn { font-size: 13px !important; height: 34px !important; min-height: 34px !important; }
#view-jobs #pipe-search-input { font-size: 16px !important; height: 40px !important; min-height: 40px !important; }
#view-jobs #stitch-job-search-row > div:first-child { height: 40px !important; }
#stitch-job-filter-toggle { height: 40px; width: 40px; flex-basis: 40px; }
.stitch-status-heading strong { font-size: 14px; }
.stitch-status-heading p, #stitch-status-activity-text, #stitch-workspace-status #btn-trigger-scan { font-size: 12px; }
#stitch-header-context { font-size: 13px; }
#stitch-automation-state { font-size: 12px; }
#view-cvs #cv-active-select, #view-cover-letters #cl-active-select { font-size: 16px !important; height: 40px !important; min-height: 40px !important; }
.stitch-document-info { font-size: 12px; }
.stitch-document-style > button, #view-cvs .mobile-studio-actions button, #view-cover-letters .mobile-studio-actions button { font-size: 13px; min-height: 40px; }
#stitch-map-location { min-height: 36px; border-radius: 12px; }
#stitch-map-location span { font-size: 14px; }
#view-map .map-radius-btn, #view-map #map-role-select-mobile { font-size: 16px !important; height: 34px !important; min-height: 34px !important; padding: 0 8px !important; border-radius: 9px !important; }
.stitch-nearby-heading { font-size: 14px; min-height: 34px; }
.stitch-nearby-heading > span:last-child, .stitch-nearby-empty { font-size: 12px; }
.stitch-nearby-identity strong { font-size: 14px; }
.stitch-nearby-identity > span, .stitch-nearby-identity small, .stitch-nearby-score { font-size: 12px; }
#stitch-map-legend { font-size: 11px; }
#view-map .map-floating-bottom-hud, #stitch-map-legend { bottom: calc(var(--mobile-dock-clearance) / var(--mobile-ui-scale) + 8px + var(--nearby-panel-height, 180px) + 12px) !important; }
#view-map .map-floating-bottom-hud { width: 40px !important; height: 40px !important; }
#view-map .map-mobile-bottom-actions { height: 40px !important; }
#view-map .map-mobile-recenter { position: relative !important; width: 40px !important; min-width: 40px !important; height: 40px !important; min-height: 40px !important; }
/* Documents have one uniform fit transform, never app zoom plus sheet scale.
   Fixed canvas geometry preserves the same A4 design as desktop/export. */
#main-view-container:has(> #view-cvs:not(.hidden)),
#main-view-container:has(> #view-cover-letters:not(.hidden)) { --mobile-ui-scale: 1; zoom: 1 !important; }
#cv-preview-stage .cv-document-sheet,
#letter-preview-stage .letter-document-sheet { aspect-ratio: 820 / 1160; -webkit-text-size-adjust: none; text-size-adjust: none; }
#view-cvs #cv-studio-toolbar, #view-cover-letters #letter-studio-toolbar { height: 44px !important; min-height: 44px !important; max-height: 44px !important; flex-basis: 44px !important; padding: 4px 10px !important; }
#view-cvs #cv-active-select, #view-cover-letters #cl-active-select { font-size: 12px !important; min-height: 32px !important; height: 32px !important; }
#view-cvs #cv-studio-toolbar > div:last-child button[onclick="printCvToPdf()"],
#view-cover-letters #letter-studio-toolbar > div:last-child button[onclick="printCoverLetterToPdf()"] { width: 32px !important; min-width: 32px !important; height: 32px !important; min-height: 32px !important; flex-basis: 32px !important; }
#view-cvs #cv-studio-toolbar button svg, #view-cover-letters #letter-studio-toolbar button svg,
#view-cvs .mobile-studio-actions svg, #view-cover-letters .mobile-studio-actions svg { width: 15px !important; height: 15px !important; }
.stitch-document-info { font-size: 10px; padding: 0 10px 6px; }
#view-cvs #cv-preview-stage, #view-cover-letters #letter-preview-stage { padding: 8px 10px !important; }
.stitch-document-style { margin: 6px 10px 0; padding: 3px 8px; }
.stitch-document-style > button { min-height: 28px; font-size: 11px; }
.stitch-document-style [data-accent] { width: 18px !important; height: 18px !important; min-width: 18px !important; min-height: 18px !important; max-width: 18px !important; max-height: 18px !important; flex-basis: 18px; }
#view-cvs .mobile-studio-actions, #view-cover-letters .mobile-studio-actions { padding: 6px 10px var(--mobile-dock-clearance); }
#view-cvs .mobile-studio-actions button, #view-cover-letters .mobile-studio-actions button { min-height: 32px; font-size: 11px; }
#view-jobs .stitch-job-card { -webkit-text-size-adjust: none; text-size-adjust: none; }
#view-jobs #job-subview-kanban .kanban-column [id^="col-"] > .stitch-job-card { padding: 10px !important; gap: 7px; margin-bottom: 8px; border-radius: 10px !important; }
.stitch-company-avatar { width: 28px; height: 28px; flex-basis: 28px; font-size: 10px; border-radius: 7px; }
.stitch-job-heading { gap: 7px; }
.stitch-job-meta > span { padding: 3px 5px; }
.stitch-job-note { padding: 5px 7px; line-height: 1.35; }
.stitch-job-actions button { min-height: 32px; padding: 3px 6px; }
.stitch-job-actions svg, .stitch-job-note svg { width: 12px; height: 12px; }
#app-layout #page-title { font-size: 16px !important; line-height: 19px; }
#view-jobs #job-subview-kanban .kanban-column > div:first-child span { font-size: 11px; }
.stitch-status-heading strong { font-size: 12px; }
.stitch-status-heading p, #stitch-status-activity-text, #stitch-workspace-status #btn-trigger-scan { font-size: 10px; }
