.recap-tool-dialog { width:min(680px,calc(100vw - 32px)); max-width:100vw; height:fit-content; max-height:calc(100dvh - 32px); padding:0; border:1px solid var(--line); border-radius:16px; background:var(--panel); color:var(--ink); overflow:hidden; box-shadow:var(--shadow-lg); }
.recap-tool-dialog::backdrop { background:#0009; }
.recap-tool-shell { display:flex; flex-direction:column; max-height:calc(100dvh - 34px); min-height:0; }
.recap-tool-dialog header,.recap-tool-dialog footer { display:flex; align-items:center; gap:10px; padding:12px 16px; flex-shrink:0; }
.recap-tool-dialog header { border-bottom:1px solid var(--line); }
.recap-tool-dialog header h2 { flex:1; font-size:1.12rem; margin:0; overflow-wrap:anywhere; }
.recap-tool-dialog button,.recap-tool-dialog input:not([type=checkbox]),.recap-tool-dialog select { min-height:44px; font:inherit; }
.recap-tool-dialog button { white-space:normal; }
.recap-tool-dialog label { display:flex; flex-direction:column; gap:6px; min-width:0; font-size:.9rem; }
.recap-tool-dialog input:not([type=checkbox]),.recap-tool-dialog select,.recap-tool-dialog textarea { box-sizing:border-box; width:100%; min-width:0; max-width:100%; padding:10px; border:1px solid var(--line); border-radius:7px; background:var(--field); color:var(--ink); font:inherit; font-size:1rem; }
.recap-tool-dialog :is(button,input,textarea,select):focus-visible { outline:3px solid var(--blue); outline-offset:2px; }
.recap-tool-dialog .primary { background:var(--accent); border-color:var(--accent); color:white; }
body.dark .recap-tool-dialog .primary { color:#071e18; }
.recap-tool-dialog textarea { resize:vertical; min-height:180px; }
.recap-tool-dialog p { overflow-wrap:anywhere; font-size:.9rem; }
.recap-tool-body { padding:16px; overflow-y:auto; min-height:0; }
.recap-tool-body > label { margin-bottom:14px; }
.recap-tool-dialog form { display:flex; flex-direction:column; min-height:0; overflow:hidden; }
.recap-tool-dialog footer { border-top:1px solid var(--line); justify-content:flex-end; flex-wrap:wrap; }
.recap-tool-grid { display:grid; grid-template-columns:1fr 1fr; gap:14px; }
.recap-tool-status { margin:0; padding:8px 16px; min-height:1.3em; font-size:.85rem; }
#recapStopEditorError { margin:0; padding:0 16px; color:var(--danger); }
#recapPlanChoiceInfo { white-space:pre-wrap; overflow-wrap:anywhere; max-height:160px; overflow:auto; }
.recap-map-dialog { width:min(1120px,calc(100vw - 24px)); height:min(880px,calc(100dvh - 24px)); }
.recap-map-dialog .recap-tool-shell { height:100%; max-height:100%; }
.recap-map-toolbar { display:flex; flex-wrap:wrap; gap:8px; padding:12px 16px 6px; }
.recap-map-controls { display:flex; align-items:end; gap:8px; padding:6px 16px; }
.recap-map-controls label:first-child { flex:1; }
.recap-map-controls label:last-child { width:100px; flex-shrink:0; }
#recapMapCanvas { flex:1; min-height:160px; background:#233439; }
.recap-map-dialog footer { padding:6px 16px; font-size:.75rem; justify-content:flex-start; }
.recap-map-popup { color:#172d32; overflow-wrap:anywhere; font:14px/1.35 system-ui,sans-serif; }
.recap-map-popup > strong,.recap-map-popup > span { display:block; margin-bottom:6px; }
.recap-map-popup > strong { display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.recap-map-popup > div { display:grid; grid-template-columns:1fr; gap:5px; }
.recap-map-popup button { border:1px solid #afc5c1; border-radius:6px; padding:8px; background:#eef7f5; color:#143e37; text-align:left; font:inherit; min-height:44px; }
.recap-map-dialog .leaflet-control-zoom a { width:44px; height:44px; line-height:44px; }
.recap-tool-dialog .recap-waypoint-choice { display:flex; flex-direction:row; align-items:center; gap:12px; padding:10px 2px; border-bottom:1px solid var(--line); min-height:44px; }
.recap-waypoint-choice input { width:22px; height:22px; flex-shrink:0; }
.recap-waypoint-choice span { min-width:0; overflow-wrap:anywhere; }
.recap-waypoint-choice small { display:block; margin-top:4px; }
.recap-tool-dialog [hidden] { display:none!important; }
.recap-reference-actions,.recap-map-entry { display:flex; flex-wrap:wrap; gap:8px; margin:10px 0; }
.recap-main-controls label { display:grid; gap:6px; }
.recap-main-controls select { width:100%; min-width:0; min-height:44px; }
.recap-main-controls > div { display:flex; flex-wrap:wrap; gap:6px; }
.recap-main-controls button { min-height:44px; white-space:normal; }
.recap-main-controls p { overflow-wrap:anywhere; }
.recap-main-focus { top:auto; bottom:30px; width:max-content; box-sizing:border-box; }
.recap-main-focus span { overflow-wrap:anywhere; max-width:100%; }
.recap-main-focus button { min-height:44px; white-space:normal; background:#eef7f5; color:#143e37; border:1px solid #afc5c1; }
.recap-source-action { margin-top:8px; min-height:44px; padding:8px 12px; background:#eef7f5; color:#143e37; border:1px solid #afc5c1; border-radius:6px; }
.recap-main-marker .symbol-pin { outline:3px solid #8b5cf6; outline-offset:2px; }
.recap-main-marker .symbol-pin__label { max-width:none; }
.recap-main-popup > span { font-size:12px; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
#mainRecapActionBody textarea { margin-top:6px; }
@media(max-height:600px) {
  .recap-map-dialog .recap-tool-shell { overflow-y:auto; }
  #recapMapCanvas { flex:none; height:300px; }
}
@media(max-width:600px) {
  .recap-main-focus { left:12px; transform:none; bottom:40px; max-width:calc(100% - 72px); }
  .recap-main-focus span { display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
  .recap-tool-dialog { width:100vw; max-width:100vw; max-height:100dvh; margin:auto 0 0; border-radius:14px 14px 0 0; }
  .recap-tool-shell { max-height:calc(100dvh - 2px); }
  .recap-map-dialog { height:100dvh; border-radius:0; margin:0; }
  .recap-tool-dialog header,.recap-tool-body { padding:12px; }
  .recap-tool-grid { grid-template-columns:1fr; }
  .recap-map-toolbar { padding:8px 10px 4px; gap:6px; }
  .recap-map-toolbar button { flex:1 1 40%; }
  .recap-map-controls { padding:4px 10px; display:grid; grid-template-columns:minmax(0,1fr) auto; }
  .recap-map-controls label:last-child { width:100%; flex-direction:row; align-items:center; grid-column:1 / -1; }
  .recap-map-controls label:last-child select { width:auto; flex:1; }
  .recap-tool-status { padding:6px 10px; font-size:.78rem; }
}
