diff --git a/src/components/profile/ProfilePanel.module.css b/src/components/profile/ProfilePanel.module.css
index aea5d08..3d2610c 100644
--- a/src/components/profile/ProfilePanel.module.css
+++ b/src/components/profile/ProfilePanel.module.css
@@ -38,14 +38,22 @@
}
.closeBtn {
+ display: inline-flex;
+ align-items: center;
+ justify-content: center;
+ /* Large touch target (≈44px) for easy tapping; negative margins pull it back
+ into the titlebar padding so the bar itself stays compact. */
+ min-width: 44px;
+ min-height: 44px;
+ margin: -8px -6px -8px 0;
background: none;
border: none;
color: #94a3b8;
- font-size: 13px;
+ font-size: 16px;
line-height: 1;
- padding: 2px 5px;
- border-radius: 3px;
+ border-radius: 6px;
cursor: pointer;
+ touch-action: manipulation;
}
.closeBtn:hover {
diff --git a/src/components/profile/ProfilePanel.tsx b/src/components/profile/ProfilePanel.tsx
index 0d85d1b..466c723 100644
--- a/src/components/profile/ProfilePanel.tsx
+++ b/src/components/profile/ProfilePanel.tsx
@@ -45,6 +45,7 @@ const DEFAULT_RECT: PanelRect = {
export function ProfilePanel({ mapRef }: Props) {
const procedure = useProfileProcedure()
const clearSelection = useSelectionStore((s) => s.clear)
+ const selectAircraft = useSelectionStore((s) => s.select)
const selectedHex = useSelectionStore((s) => selectedHexOf(s.selected))
const procedures = useProcedureStore((s) => s.procedures)
@@ -111,8 +112,15 @@ export function ProfilePanel({ mapRef }: Props) {
const containerW = containerRect.width
const containerH = containerRect.height
- const width = Math.min(720, Math.max(PROFILE_PANEL_MIN_W, containerW - 2 * PROFILE_MARGIN_PX))
- const height = Math.min(PROFILE_PANEL_MIN_H, Math.max(160, containerH - 2 * PROFILE_MARGIN_PX))
+ // Fit within the viewport width. On phones (portrait ≈ 360 CSS px) the
+ // 520px preferred width overflows the screen edge, so cap to what's
+ // available rather than forcing the desktop minimum.
+ const available = Math.max(160, containerW - 2 * PROFILE_MARGIN_PX)
+ const width = Math.min(720, available)
+ // A narrow (phone) layout wraps the header boxes onto extra rows; give it
+ // more vertical room so the wrapped header doesn't squeeze the plot.
+ const maxHeight = width < PROFILE_PANEL_MIN_W ? 400 : PROFILE_PANEL_MIN_H
+ const height = Math.min(maxHeight, Math.max(160, containerH - 2 * PROFILE_MARGIN_PX))
const candidates: Rect[] = [
{ x: PROFILE_MARGIN_PX, y: PROFILE_MARGIN_PX, w: width, h: height },
@@ -263,7 +271,15 @@ export function ProfilePanel({ mapRef }: Props) {
onPointerCancel={onTitlebarPointerUp}
>
Vertical Profile
-