.picker-window {
  min-height: 100dvh;
  margin: 0;
  display: grid;
  place-items: center;
  background: #101e21;
  color: #e4efeb;
  font: 15px system-ui, sans-serif;
}
.cir-picker {
  box-sizing: border-box;
  width: min(1180px, calc(100vw - 36px));
  max-height: calc(100dvh - 36px);
  padding: 0;
  overflow: auto;
  color-scheme: dark;
  color: #e7f0ec;
  border: 1px solid #42574f;
  border-radius: 13px;
  background: #152321;
  box-shadow: 0 24px 100px #0009;
  font: 14px/1.4 system-ui, sans-serif;
  --muted: #a8bdb3;
  --rule: #354943;
  --bright: #cdec9c;
}
.cir-picker::backdrop { background: #0c1719d9; backdrop-filter: blur(5px); }
.cir-picker *, .cir-picker *::before, .cir-picker *::after { box-sizing: border-box; }
.cir-picker [hidden] { display: none !important; }
.cir-picker button, .cir-picker input {
  min-height: 36px;
  min-width: 0;
  margin: 0;
  border: 1px solid #4c645a;
  border-radius: 6px;
  padding: 6px 12px;
  color: inherit;
  background: #253832;
  font: inherit;
  font-weight: 600;
}
.cir-picker button { cursor: pointer; }
.cir-picker button:hover:not(:disabled) { border-color: #7f9b87; background: #344b40; }
.cir-picker button:disabled { cursor: default; opacity: .48; }
.cir-picker :focus-visible { outline: 2px solid #cdec9c; outline-offset: 2px; }
.cir-picker button[aria-pressed="true"], .cir-picker .picker-primary {
  color: #19281b;
  background: var(--bright);
  border-color: var(--bright);
}
.cir-picker button[aria-pressed="true"]:hover:not(:disabled), .cir-picker .picker-primary:hover:not(:disabled) {
  color: #19281b;
  background: #e0f7b9;
}
.picker-head { display: flex; align-items: start; justify-content: space-between; gap: 16px; padding: 22px 24px 16px; }
.cir-picker h1, .cir-picker h2, .cir-picker h3, .cir-picker p { margin: 0; }
.cir-picker h1 { font-size: clamp(22px, 3vw, 31px); font-weight: 700; letter-spacing: -.04em; line-height: 1.15; }
.cir-picker h2 { font-size: 15px; line-height: 1.25; letter-spacing: -.01em; }
.cir-picker h3 { font-size: 14px; }
.picker-head p { margin-top: 5px; color: var(--muted); }
.picker-close { flex: none; font-size: 20px !important; line-height: 1.1 !important; }
.picker-steps { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 0 24px; border-top: 1px solid var(--rule); padding: 12px 0; list-style: none; color: var(--muted); }
.picker-steps li { display: flex; align-items: center; gap: 8px; font-weight: 630; }
.picker-steps li:not(:last-child)::after { content: '→'; margin-left: 8px; color: #71877d; }
.picker-steps [aria-current="step"] { color: var(--bright); }
.picker-body { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 16px; padding: 0 24px 18px; }
.picker-workspace, .picker-side { min-width: 0; display: flex; flex-direction: column; gap: 11px; }
.picker-tools, .picker-search, .picker-actions, .picker-foot { display: flex; align-items: center; gap: 7px; }
.picker-tools { flex-wrap: wrap; }
.picker-search { flex: 1 1 250px; }
.cir-picker input { width: 100%; background: #101b19; font-weight: 450; }
.picker-search-results { margin: 0; padding: 7px; display: grid; gap: 5px; list-style: none; border: 1px solid var(--rule); border-radius: 8px; background: #1c2d28; }
.picker-search-results button { width: 100%; text-align: start; }
.picker-map {
  position: relative;
  flex: 1;
  min-height: clamp(350px, 55vh, 570px);
  overflow: hidden;
  border: 1px solid #576b62;
  border-radius: 9px;
  background: #334948;
  isolation: isolate;
  touch-action: none;
  cursor: grab;
}
.picker-map[data-mode="draw"] { cursor: crosshair; }
.picker-map[data-dragging="pan"] { cursor: grabbing; }
.picker-raster { position: absolute; inset: 0; pointer-events: none; }
.picker-raster img { position: absolute; display: block; width: 256px; height: 256px; user-select: none; }
.picker-map-zoom { position: absolute; top: 12px; right: 12px; display: grid; gap: 3px; z-index: 2; }
.picker-map-zoom button { width: 36px; padding: 4px; color: #f4fff8; background: #172722ee; font-size: 19px; line-height: 1; }
.picker-credit { position: absolute; z-index: 2; right: 0; bottom: 0; color: #e3ece6; background: #152521ed; padding: 4px 8px; font-size: 11px; }
.picker-credit a { color: inherit; }
.picker-scale { position: absolute; bottom: 13px; left: 12px; color: #f4fff8; background: #172722ee; padding: 3px 7px; border-bottom: 2px solid #e9f4ed; text-align: center; white-space: nowrap; font: 600 11px/1.3 ui-monospace, monospace; }
.picker-selection { position: absolute; border: 2px solid #16432f; outline: 1px solid #f9ffef; background: #63b67a42; pointer-events: none; }
.picker-selection[data-invalid="true"] { border-color: #a01632; background: #e8345252; }
.picker-handle { position: absolute; width: 14px; height: 14px; border: 2px solid #143629; outline: 1px solid #f9ffef; border-radius: 2px; background: #e2f8bb; pointer-events: auto; }
.picker-selection[data-invalid="true"] .picker-handle { border-color: #a01632; background: #ffbdc6; }
.picker-handle[data-corner="nw"] { left: -8px; top: -8px; cursor: nwse-resize; }
.picker-handle[data-corner="ne"] { right: -8px; top: -8px; cursor: nesw-resize; }
.picker-handle[data-corner="sw"] { left: -8px; bottom: -8px; cursor: nesw-resize; }
.picker-handle[data-corner="se"] { right: -8px; bottom: -8px; cursor: nwse-resize; }
.picker-dim { position: absolute; left: 50%; bottom: calc(100% + 11px); transform: translateX(-50%); background: #172722f5; border: 1px solid #577367; color: #f1fff6; border-radius: 5px; padding: 4px 8px; font: 650 12px/1.25 ui-monospace, monospace; white-space: nowrap; }
.picker-selection[data-invalid="true"] .picker-dim { background: #52212c; color: #ffd6de; border-color: #e28191; }
.picker-card { display: grid; gap: 9px; padding: 12px; border: 1px solid var(--rule); border-radius: 9px; background: #1e3029; }
.picker-card p, .picker-side small, .picker-empty { color: var(--muted); }
.picker-list { display: grid; gap: 5px; margin: 0; padding: 0; list-style: none; }
.picker-list button { display: flex; align-items: center; gap: 8px; width: 100%; text-align: start; }
.picker-list small { display: block; font-weight: 400; }
.picker-list img { width: 42px; height: 32px; border-radius: 3px; object-fit: contain; background: #152321; }
.picker-preview { display: grid; gap: 7px; }
.picker-thumb { width: 100%; height: 172px; object-fit: contain; display: block; border-radius: 5px; background: #111d1a; }
.picker-counts { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; margin: 0; }
.picker-counts div { display: flex; justify-content: space-between; gap: 5px; background: #16251f; border-radius: 4px; padding: 4px 7px; }
.picker-counts dt { color: var(--muted); font-size: 12px; }
.picker-counts dd { margin: 0; font-variant-numeric: tabular-nums; font-weight: 700; }
.picker-foot { justify-content: space-between; padding: 12px 24px; border-top: 1px solid var(--rule); background: #182a24; }
.cir-picker .picker-status { color: var(--muted); overflow-wrap: anywhere; }
.cir-picker .picker-status[data-error="true"] { color: #ffc0cb; }
.picker-progress { display: grid; gap: 4px; flex: 1; }
.picker-progress progress { width: min(300px, 100%); height: 9px; accent-color: var(--bright); }
@media (min-width: 781px) and (min-height: 700px) {
  .cir-picker[open] {
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    height: min(770px, calc(100dvh - 24px));
    max-height: calc(100dvh - 24px);
  }
  .picker-head { padding-top: 14px; padding-bottom: 10px; }
  .picker-steps { padding-block: 8px; }
  .picker-body { min-height: 0; padding-bottom: 12px; }
  .picker-workspace, .picker-side, .picker-map { min-height: 0; }
  .picker-search-results { max-height: 35%; overflow-y: auto; }
  .picker-side { gap: 8px; }
  .picker-card { flex-shrink: 0; gap: 5px; padding: 8px; }
  .picker-card:has(.picker-preview:not([hidden])) { grid-template-columns: 1fr auto; align-items: center; }
  .picker-preview { grid-column: 1 / -1; gap: 5px; }
  .picker-thumb { height: clamp(90px, 14dvh, 172px); }
  .picker-counts { gap: 4px; }
  .picker-counts div { padding: 2px 6px; }
  .picker-list { gap: 4px; }
  .picker-list button { min-height: 0; padding: 4px 8px; line-height: 1.2; }
  .picker-recent-card { flex-shrink: 1; min-height: 0; grid-template-rows: auto minmax(0, 1fr); }
  .picker-recents { min-height: 0; overflow-y: auto; grid-template-columns: minmax(0, 1fr); align-content: start; padding: 3px; }
  .picker-recents:empty { display: none; }
  .picker-recents img { flex-shrink: 0; }
  .picker-recents button > span, .picker-recents small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .picker-foot { padding-block: 8px; }
}
@media (max-width: 780px) {
  .picker-body { grid-template-columns: minmax(0, 1fr); }
  .picker-side { display: grid; grid-template-columns: 1fr 1fr; }
  .picker-side > :first-child { grid-column: 1 / -1; }
}
@media (max-width: 500px) {
  .cir-picker { width: calc(100vw - 12px); max-height: calc(100dvh - 12px); }
  .picker-head, .picker-body, .picker-foot { padding-left: 12px; padding-right: 12px; }
  .picker-steps { margin: 0 12px; gap: 5px; }
  .picker-steps li:not(:last-child)::after { margin-left: 0; }
  .picker-foot { align-items: start; flex-direction: column; }
}
