/* Plan symbols stay crisp at every zoom level and use the same visual weight. */
.plan-symbol { display: inline-block; width: 20px; height: 20px; flex: 0 0 auto; vertical-align: middle; pointer-events: none; }
.plan-pin-layer .plan-symbol { color: #fff; overflow: visible; }
.plan-pin-layer .plan-symbol rect { fill: none; stroke: currentColor; stroke-width: 2; }
.plan-pin-layer .plan-pin > circle { filter: drop-shadow(0 2px 3px #0005); }
.plan-pin-layer .plan-pin:hover > circle { stroke: #b8efff; stroke-width: 3; }
.plan-pin-layer .plan-pin.pin-type-obstruction > circle { fill: #a65c09; }
.plan-pin-layer .plan-pin.pin-type-obstruction .plan-area-shape { fill: rgba(166,92,9,.16); stroke: #a65c09; }
.plan-pin-layer .plan-pin:focus-visible > circle { stroke: #7de3ff; stroke-width: 4; }
.plan-pin-layer .plan-pin.is-focused > circle { stroke: #ffe66d; stroke-width: 5; filter: drop-shadow(0 0 12px #ffdb3d); }

/* Full labels and restrained category colours make the legend easy to scan. */
.plan-marker-legend { gap: 8px; }
.plan-marker-legend > span { display: inline-flex; align-items: center; gap: 6px; padding: 6px 9px; border: 1px solid #c6e0eb; border-radius: 7px; color: #126180; background: #edf7fb; font-size: 12px; font-weight: 650; line-height: 1.4; }
.plan-marker-legend .plan-symbol { width: 17px; height: 17px; }
.plan-marker-legend > .note { color: #425b68; border-color: #d3dfe5; background: #f1f5f7; }
.plan-marker-legend > .defect { color: #ad303b; border-color: #efcbd0; background: #fff1f2; }
.plan-marker-legend > .obstruction { color: #8c4b06; border-color: #ebd5b6; background: #fff6e9; }
.plan-marker-legend > .extra_work { color: #136444; border-color: #c3e2d5; background: #edf8f2; }
.plan-pin-card > span.obstruction, .worker-plan-marker > span:first-child.obstruction { background: #a65c09; }
#planPinList .plan-pin-card { grid-template-columns: 44px 32px minmax(0,1fr) auto; }
#planPinList .plan-pin-card > span { width: 32px; height: 32px; border-radius: 8px; }
.plan-pin-task-toggle, .plan-pin-delete { display: grid; place-items: center; }
.plan-pin-task-toggle .plan-symbol, .plan-pin-delete .plan-symbol { width: 17px; height: 17px; }
.plan-viewer-toolbar button:has(.plan-symbol), .plan-focused-task button:has(.plan-symbol) { display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
.plan-viewer-toolbar [data-plan-icon] { display: inline-flex; }
.plan-pin-geometry-summary > span .plan-symbol { width: 23px; height: 23px; }

html[data-theme="dark"] .plan-marker-legend > .task { color: #a5dff5; border-color: #335d70; background: #112f3d; }
html[data-theme="dark"] .plan-marker-legend > .note { color: #cedce3; border-color: #485f6b; background: #22343e; }
html[data-theme="dark"] .plan-marker-legend > .defect { color: #ffb8bf; border-color: #75434c; background: #3b2029; }
html[data-theme="dark"] .plan-marker-legend > .obstruction { color: #ffd297; border-color: #745530; background: #392c1c; }
html[data-theme="dark"] .plan-marker-legend > .extra_work { color: #9be3bf; border-color: #34624f; background: #18372b; }
html[data-theme="dark"] .plan-pin-card.completed { border-color: #386f5b; background: #12372e; }

/* Native radio choices expose every category and its symbol before selection. */
#planPinKindPicker { min-width: 0; margin: 0; padding: 0; border: 0; }
#planPinKindPicker > legend { margin-bottom: 8px; padding: 0; color: var(--text); font-size: 14px; font-weight: 650; letter-spacing: 0; text-transform: none; }
.plan-kind-options { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
#planPinKindPicker .plan-kind-option { min-width: 0; min-height: 54px; display: grid; grid-template-columns: 32px minmax(0,1fr) 20px; align-items: center; gap: 9px; margin: 0; padding: 10px 12px; border: 1px solid #cddce3; border-radius: 10px; color: #173247; background: #fff; cursor: pointer; }
#planPinKindPicker .plan-kind-option[hidden] { display: none; }
#planPinKindPicker .plan-kind-option:last-child { grid-column: 1 / -1; }
#planPinKindPicker .plan-kind-option > input { grid-column: 3; grid-row: 1; width: 20px; height: 20px; margin: 0; accent-color: #0879a4; }
#planPinKindPicker .plan-kind-symbol { grid-column: 1; grid-row: 1; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 8px; color: #126180; background: #edf7fb; }
#planPinKindPicker .plan-kind-symbol.note { color: #425b68; background: #f1f5f7; }
#planPinKindPicker .plan-kind-symbol.defect { color: #ad303b; background: #fff1f2; }
#planPinKindPicker .plan-kind-symbol.obstruction { color: #8c4b06; background: #fff6e9; }
#planPinKindPicker .plan-kind-symbol.extra_work { color: #136444; background: #edf8f2; }
#planPinKindPicker .plan-kind-label { grid-column: 2; grid-row: 1; color: inherit; font-size: 14px; font-weight: 600; line-height: 1.4; letter-spacing: 0; text-transform: none; overflow-wrap: anywhere; }
#planPinKindPicker .plan-kind-option:hover { border-color: #7ca9ba; background: #f5fafc; }
#planPinKindPicker .plan-kind-option:has(input:checked) { border-color: #0879a4; background: #edf8fc; box-shadow: inset 0 0 0 1px #0879a4; }
#planPinKindPicker .plan-kind-option:has(input:focus-visible) { outline: 3px solid #0879a4; outline-offset: 3px; }
html[data-theme="dark"] #planPinKindPicker .plan-kind-option { color: #dcebee; border-color: #425d68; background: #0b2028; }
html[data-theme="dark"] #planPinKindPicker .plan-kind-option:hover { border-color: #81bec7; background: #173843; }
html[data-theme="dark"] #planPinKindPicker .plan-kind-option:has(input:checked) { border-color: #77e7db; background: #143b40; box-shadow: inset 0 0 0 1px #77e7db; }
html[data-theme="dark"] #planPinKindPicker .plan-kind-option:has(input:focus-visible) { outline-color: #77e7db; }
html[data-theme="dark"] #planPinKindPicker .plan-kind-option > input { accent-color: #77e7db; }
@media (max-width: 430px) {
  .plan-kind-options { grid-template-columns: 1fr; }
}
/* Task details distinguish a saved plan location from the action to create one. */
.task-plan-location-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.project-task-detail .task-plan-location-head h4 { margin: 0; font-size: 14px; }
.task-plan-state { display: inline-flex; align-items: center; gap: 5px; padding: 5px 8px; border: 1px solid #d4e0e5; border-radius: 7px; color: #49616f; background: #f2f6f8; font-size: 12px; font-weight: 650; line-height: 1.4; }
.task-plan-state .plan-symbol { width: 15px; height: 15px; }
.task-plan-state.is-marked { border-color: #b7ddcb; color: #116342; background: #edf8f2; }
.project-task-detail .task-plan-location p { font-size: 13px; }
.task-plan-location-detail strong, .task-plan-location-detail span { display: block; overflow-wrap: anywhere; }
.task-plan-location-detail strong { color: var(--text); font-size: 14px; font-weight: 650; }
.task-plan-location-detail span { margin-top: 3px; }
.project-task-detail .task-plan-action { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 44px; }
html[data-theme="dark"] .task-plan-state { border-color: #425d68; color: #c8dce3; background: #17323e; }
html[data-theme="dark"] .task-plan-state.is-marked { border-color: #386f5b; color: #9be3bf; background: #12372e; }
@media (forced-colors: active) {
  html[data-theme] .plan-marker-legend > span[class] { color: CanvasText; border-color: CanvasText; background: Canvas; }
  html[data-theme] .plan-pin-layer .plan-pin > circle { fill: Canvas; stroke: CanvasText; }
  html[data-theme] .plan-pin-layer .plan-symbol { color: CanvasText; }
}
