
:root{
  --ui-bg:#f4f7f8;
  --ui-surface:#fff;
  --ui-surface-soft:#f7fafb;
  --ui-text:#1f2933;
  --ui-muted:#6b7782;
  --ui-border:#dfe6ea;
  --ui-primary:#79c900;
  --ui-primary-dark:#5d9e00;
  --ui-warning:#f0ad00;
  --ui-danger:#d9534f;
  --ui-radius:12px;
  --ui-radius-sm:9px;
  --ui-gap:12px;
  --ui-shadow:0 2px 10px rgba(25,45,55,.06);
}

/* Stage 14: unified compact UI */
*{box-sizing:border-box}
body{
  background:var(--ui-bg);
  color:var(--ui-text);
}
.container,.page,.content,.main-content{
  max-width:1180px;
}
.card,.panel,.object-card,.tree-card,.form-section,.object-location-box,
.compact-object-photo-picker{
  border:1px solid var(--ui-border);
  border-radius:var(--ui-radius);
  background:var(--ui-surface);
  box-shadow:var(--ui-shadow);
}
.card{padding:16px}
h1{font-size:clamp(22px,3vw,30px);line-height:1.15;margin:0 0 14px}
h2{font-size:18px;line-height:1.25;margin:0 0 10px}
p{line-height:1.45}
.muted{color:var(--ui-muted)}
button,.button,input,select,textarea{font:inherit}
.button{
  min-height:42px;
  padding:9px 14px;
  border-radius:var(--ui-radius-sm);
  border:1px solid var(--ui-border);
  cursor:pointer;
}
.button-large{min-height:48px}
.button-small{min-height:36px;padding:7px 10px;font-size:14px}
.full-width{width:100%}

.form-section,.object-location-box,.compact-object-photo-picker{
  margin:12px 0;
  padding:14px;
}
.location-controls,.compact-photo-actions{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}
.geo-status,.photo-count{
  margin-top:9px;
  padding:8px 10px;
  border-radius:var(--ui-radius-sm);
  background:var(--ui-surface-soft);
  color:var(--ui-muted);
}
.compact-section-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  margin-bottom:10px;
}
.compact-section-head p{
  margin:2px 0 0;
  color:var(--ui-muted);
  font-size:14px;
}
.badge{
  flex:0 0 auto;
  padding:5px 8px;
  border-radius:999px;
  background:#edf5e6;
  color:#507f18;
  font-size:12px;
  font-weight:700;
}
.compact-photo-preview{
  display:grid;
  grid-template-columns:repeat(5,minmax(0,1fr));
  gap:7px;
  margin-top:10px;
}
.compact-photo-preview img{
  width:100%;
  aspect-ratio:1;
  object-fit:cover;
  border-radius:8px;
}
.hidden-photo-input{display:none!important}

.leaflet-container{
  border-radius:var(--ui-radius);
  overflow:hidden;
}

@media(max-width:768px){
  body{font-size:15px}
  .card{padding:12px;border-radius:10px}
  .form-section,.object-location-box,.compact-object-photo-picker{
    padding:11px;
    margin:9px 0;
    border-radius:10px;
  }
  h1{font-size:23px;margin-bottom:10px}
  h2{font-size:17px}
  .button{
    min-height:40px;
    padding:8px 11px;
  }
  .location-controls,.compact-photo-actions{
    display:grid;
    grid-template-columns:1fr 1fr;
  }
  .location-controls .button,.compact-photo-actions .button{
    width:100%;
  }
  .compact-section-head{
    gap:8px;
  }
  .compact-section-head p{font-size:13px}
  .compact-photo-preview{
    grid-template-columns:repeat(3,minmax(0,1fr));
  }
}

@media(max-width:430px){
  .location-controls,.compact-photo-actions{
    grid-template-columns:1fr;
  }
  .compact-photo-preview{
    grid-template-columns:repeat(3,minmax(0,1fr));
  }
}


/* Stage 15: compact hierarchy / remove visual nesting */
.page-title,
.object-page-header,
.tree-page-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin:0 0 12px;
}
.page-title > div,
.object-page-header > div,
.tree-page-header > div{
  min-width:0;
}
.page-title h1,
.object-page-header h1,
.tree-page-header h1{
  margin:0;
}
.page-title p,
.object-page-header p,
.tree-page-header p{
  margin:4px 0 0;
}
.page-title .actions,
.object-page-header .actions,
.tree-page-header .actions{
  display:flex;
  flex-wrap:wrap;
  gap:7px;
  margin-left:auto;
}

/* Treat utility rows as one line rather than nested cards. */
.object-actions,
.tree-actions,
.object-meta,
.object-toolbar,
.tree-toolbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  flex-wrap:wrap;
  gap:8px;
  margin:0 0 10px;
  padding:0;
  background:transparent;
  border:0;
  box-shadow:none;
}

/* Nested cards should read as sections, not cards inside cards. */
.card .card,
.card .panel,
.card .object-card,
.card .tree-card,
.object-card .card,
.tree-card .card{
  box-shadow:none;
}

/* Lists of trees/objects: light separators instead of a card per item. */
.object-tree-section,
.tree-list,
.object-list{
  background:transparent;
  border:0;
  box-shadow:none;
  padding:0;
}
.tree-choice,
.assignment-tree-card{
  border-radius:9px;
  box-shadow:none;
}

/* Compact section headings */
.form-section > h2,
.object-location-box > h2,
.compact-object-photo-picker h2{
  margin-bottom:8px;
}
.form-section > h2 + p,
.object-location-box > h2 + p{
  margin-top:-3px;
}

/* Desktop: keep the main work area readable without oversized empty space. */
@media(min-width:769px){
  .card{padding:14px 16px}
  .form-section,.object-location-box,.compact-object-photo-picker{
    margin:9px 0;
    padding:12px 14px;
  }
}

/* Mobile: hierarchy first, controls second. */
@media(max-width:768px){
  .page-title,
  .object-page-header,
  .tree-page-header{
    align-items:flex-start;
    gap:8px;
    margin-bottom:9px;
  }
  .page-title .actions,
  .object-page-header .actions,
  .tree-page-header .actions{
    margin-left:0;
    width:100%;
  }
  .object-actions,
  .tree-actions,
  .object-meta,
  .object-toolbar,
  .tree-toolbar{
    justify-content:flex-start;
  }
}

/* Stage 16: photo in crew assignment is an actual openable link */
.assignment-tree-photo-link{
  display:block;
  width:110px;
  height:82px;
  border-radius:10px;
  overflow:hidden;
  background:#eef3f6;
}
.assignment-tree-photo-link .assignment-tree-photo{
  display:block;
  width:100%;
  height:100%;
  object-fit:cover;
  transition:transform .15s ease;
}
.assignment-tree-photo-link:hover .assignment-tree-photo{
  transform:scale(1.025);
}
@media(max-width:900px){
  .assignment-tree-photo-link{width:90px;height:72px}
}
@media(max-width:480px){
  .assignment-tree-photo-link{width:100%;height:180px}
}

/* Stage 17: semantic surfaces instead of nested cards */
.ui-section{
  margin:10px 0;
  padding:14px;
  background:var(--ui-surface);
  border:1px solid var(--ui-border);
  border-radius:var(--ui-radius);
  box-shadow:none;
}
.ui-section > :first-child{margin-top:0}
.ui-section > :last-child{margin-bottom:0}
.ui-section-form{padding:14px 16px}
.ui-two-columns{
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(280px,360px);
  gap:12px;
  align-items:start;
}
.ui-two-columns > div{min-width:0}
.ui-two-columns .ui-section{margin:0 0 10px}
.object-map-card{overflow:hidden}
.object-map-card .object-map,
.object-map-card #object-trees-map{border-radius:10px}
.ui-section .card{
  box-shadow:none;
  border-color:var(--ui-border);
}
@media(max-width:900px){
  .ui-two-columns{grid-template-columns:1fr}
}
@media(max-width:768px){
  .ui-section{padding:11px;margin:8px 0;border-radius:10px}
  .ui-section-form{padding:11px}
  .ui-two-columns{gap:8px}
  .ui-two-columns .ui-section{margin-bottom:8px}
}

/* Stage 18: worker assignment - clear photo affordance */
.assignment-tree-photo-link{
  position:relative;
  display:block;
  width:110px;
  height:82px;
  border-radius:10px;
  overflow:hidden;
  background:#eef3f6;
  text-decoration:none;
}
.assignment-tree-photo-open{
  position:absolute;
  left:6px;
  bottom:6px;
  padding:4px 7px;
  border-radius:6px;
  background:rgba(0,0,0,.62);
  color:#fff;
  font-size:11px;
  line-height:1;
  pointer-events:none;
}
.assignment-tree-photo-link:hover .assignment-tree-photo{
  transform:scale(1.03);
}
@media(max-width:900px){
  .assignment-tree-photo-link{width:90px;height:72px}
}
@media(max-width:480px){
  .assignment-tree-photo-link{width:100%;height:180px}
}

/* Stage 19: worker assignment object map */
.worker-object-map-block{
  margin:12px 0 14px;
  padding:10px;
  background:var(--ui-surface-soft);
  border:1px solid var(--ui-border);
  border-radius:10px;
}
.worker-object-map-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  margin-bottom:8px;
}
.worker-object-map{
  width:100%;
  height:300px;
  border-radius:9px;
  overflow:hidden;
}
.worker-map-legend{
  display:flex;
  flex-wrap:wrap;
  gap:7px 12px;
  margin-top:8px;
  font-size:12px;
  color:var(--ui-muted);
}
.worker-map-legend span{
  display:inline-flex;
  align-items:center;
  gap:5px;
}
.worker-map-legend i{
  width:10px;
  height:10px;
  border-radius:50%;
  display:inline-block;
  border:1px solid rgba(0,0,0,.12);
}
.worker-tree-map-label{
  background:transparent!important;
  border:0!important;
}
.worker-tree-map-label span{
  display:block;
  width:max-content;
  min-width:28px;
  padding:3px 5px;
  border-radius:6px;
  background:rgba(255,255,255,.92);
  box-shadow:0 1px 5px rgba(20,45,60,.16);
  color:#25323a;
  font-size:11px;
  font-weight:700;
  text-align:center;
}
.worker-map-photo{
  display:block;
  position:relative;
  margin-top:8px;
  border-radius:8px;
  overflow:hidden;
  text-decoration:none;
}
.worker-map-photo img{
  display:block;
  width:100%;
  max-height:170px;
  object-fit:cover;
}
.worker-map-photo span{
  position:absolute;
  left:6px;
  bottom:6px;
  padding:4px 7px;
  border-radius:6px;
  background:rgba(0,0,0,.62);
  color:#fff;
  font-size:11px;
}
@media(max-width:768px){
  .worker-object-map-block{margin:9px 0 11px;padding:8px}
  .worker-object-map{height:260px}
}
@media(max-width:430px){
  .worker-object-map{height:230px}
}

/* Stage 20: worker dashboard */
.worker-dashboard-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  margin:0 0 18px;
}
.worker-dashboard-head h1{margin:0}
.worker-dashboard-head p{margin:5px 0 0}
.worker-dashboard-actions{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}
.worker-section-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin:0 0 9px;
}
.worker-section-head h2{margin:0}
.assignment-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:10px;
}
.assignment-card{
  display:block;
  color:inherit;
  text-decoration:none;
  margin:0;
  transition:transform .12s ease, border-color .12s ease;
}
.assignment-card:hover{
  transform:translateY(-1px);
}
.assignment-card .assignment-card-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:10px;
}
.assignment-card .assignment-card-head h2{margin:2px 0 0}
.assignment-card .assignment-date{
  color:var(--ui-primary-dark);
  font-size:13px;
  font-weight:700;
}
.assignment-card .assignment-task-summary,
.assignment-card .assignment-meta{
  display:flex;
  flex-wrap:wrap;
  gap:7px 14px;
  margin-top:9px;
}
.worker-records-section{margin-top:16px}
.record-row-link{
  text-decoration:none;
  color:inherit;
}
@media(max-width:800px){
  .worker-dashboard-head{
    align-items:flex-start;
    flex-direction:column;
    gap:9px;
    margin-bottom:13px;
  }
  .worker-dashboard-actions{width:100%}
  .assignment-grid{grid-template-columns:1fr}
}
@media(max-width:480px){
  .worker-dashboard-actions .button{flex:1 1 100%}
  .assignment-card .assignment-card-head{flex-direction:column}
  .assignment-card .assignment-meta,
  .assignment-card .assignment-task-summary{gap:6px 10px}
}

/* Stage 21: worker record */
.record-page-grid{
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(290px,360px);
  gap:12px;
  align-items:start;
}
.record-photos-section{min-width:0}
.record-section-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom:10px;
}
.record-section-head h2{margin:0}
.record-section-head p{margin:3px 0 0}
.record-details{min-width:0}
.record-photo-link{
  position:relative;
  display:block;
  overflow:hidden;
  border-radius:9px;
  background:#eef3f6;
}
.record-photo-link img{
  display:block;
  width:100%;
  aspect-ratio:4/3;
  object-fit:cover;
  transition:transform .15s ease;
}
.record-photo-link::after{
  content:"Открыть фото";
  position:absolute;
  left:7px;
  bottom:7px;
  padding:4px 7px;
  border-radius:6px;
  background:rgba(0,0,0,.62);
  color:#fff;
  font-size:11px;
  opacity:.95;
}
.record-photo-link:hover img{transform:scale(1.025)}
.record-photos-section .gallery{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:9px;
}
.record-photos-section .gallery figure{
  margin:0;
  min-width:0;
}
.record-photos-section .gallery figcaption{
  margin-top:5px;
  font-size:12px;
  color:var(--ui-muted);
}
.record-details .sticky-card{top:12px}
@media(max-width:900px){
  .record-page-grid{grid-template-columns:1fr}
  .record-details .sticky-card{position:static}
}
@media(max-width:600px){
  .record-photos-section .gallery{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:380px){
  .record-photos-section .gallery{grid-template-columns:1fr}
}

/* Stage 29: shared tree information card */
.tree-details-card{margin-top:0}
.tree-details-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom:10px;
}
.tree-details-head h2{margin:0}
.tree-details-head p{margin:3px 0 0}
.tree-details-card .details{margin:0}
.tree-details-card .details dt{font-weight:600}
.tree-details-card .details dd{margin-bottom:8px}
.tree-photo-gallery{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:9px;
}
.tree-photo-gallery figure{margin:0}
.tree-photo-gallery a{display:block;overflow:hidden;border-radius:9px}
.tree-photo-gallery img{
  display:block;
  width:100%;
  aspect-ratio:4/3;
  object-fit:cover;
  transition:transform .15s ease;
}
.tree-photo-gallery a:hover img{transform:scale(1.025)}
@media(max-width:600px){
  .tree-photo-gallery{grid-template-columns:repeat(2,minmax(0,1fr))}
  .tree-details-head{align-items:flex-start}
}
@media(max-width:380px){
  .tree-photo-gallery{grid-template-columns:1fr}
}

/* Stage 30: tree editor */
.tree-edit-layout{
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(260px,340px);
  gap:12px;
  align-items:start;
}
.tree-edit-main{min-width:0}
.tree-edit-side{min-width:0}
.tree-edit-side .ui-section + .ui-section{margin-top:12px}
.tree-edit-side .details{margin:0}
.tree-edit-comment{margin-top:10px}
.tree-edit-section-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:10px;
  margin-bottom:9px;
}
.tree-edit-section-head h2{margin:0}
.tree-edit-section-head p{margin:3px 0 0}
.tree-edit-gallery{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:9px;
}
.tree-edit-gallery figure{margin:0}
.tree-edit-gallery a{
  display:block;
  position:relative;
  overflow:hidden;
  border-radius:9px;
  text-decoration:none;
}
.tree-edit-gallery img{
  display:block;
  width:100%;
  aspect-ratio:4/3;
  object-fit:cover;
  transition:transform .15s ease;
}
.tree-edit-gallery a:hover img{transform:scale(1.025)}
.tree-edit-gallery a span{
  position:absolute;
  left:6px;
  bottom:6px;
  padding:4px 7px;
  border-radius:6px;
  background:rgba(0,0,0,.62);
  color:#fff;
  font-size:11px;
}
.tree-edit-actions{
  display:flex;
  justify-content:flex-end;
  gap:8px;
  margin-top:14px;
}
.tree-edit-note ul{
  margin:0 0 9px;
  padding-left:19px;
}
.tree-edit-note li+li{margin-top:5px}
.tree-edit-note p{margin:0}
@media(max-width:900px){
  .tree-edit-layout{grid-template-columns:1fr}
  .tree-edit-side{display:grid;grid-template-columns:1fr 1fr;gap:10px}
  .tree-edit-side .ui-section + .ui-section{margin-top:0}
}
@media(max-width:600px){
  .tree-edit-side{grid-template-columns:1fr}
  .tree-edit-gallery{grid-template-columns:repeat(2,minmax(0,1fr))}
  .tree-edit-actions{flex-direction:column-reverse}
  .tree-edit-actions .button{width:100%}
}
@media(max-width:380px){
  .tree-edit-gallery{grid-template-columns:1fr}
}

/* Stage 31: object editor */
.simple-object-edit{
  display:grid;
  gap:12px;
}
.simple-edit-form{
  display:grid;
  gap:11px;
}
.simple-edit-form .two-field-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:10px;
}
.simple-edit-form label{
  display:block;
}
.simple-edit-form .object-location-box{
  margin:0;
}
.advanced-edit-details{
  border:1px solid var(--ui-border);
  border-radius:10px;
  background:var(--ui-surface-soft);
}
.advanced-edit-details summary{
  padding:10px 12px;
  cursor:pointer;
  font-weight:700;
}
.advanced-edit-body{
  display:grid;
  gap:10px;
  padding:0 12px 12px;
}
.object-photo-gallery{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:9px;
}
.object-photo-item{
  margin:0;
  min-width:0;
}
.object-photo-item > a{
  display:block;
  position:relative;
  overflow:hidden;
  border-radius:9px;
}
.object-photo-item img{
  display:block;
  width:100%;
  aspect-ratio:4/3;
  object-fit:cover;
}
.object-photo-item figcaption{
  margin-top:6px;
}
.compact-existing-photo-form{margin-top:10px}
.compact-stage-list{
  display:grid;
  gap:7px;
}
.stage-row{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto auto;
  align-items:center;
  gap:8px;
  padding:9px 10px;
  border:1px solid var(--ui-border);
  border-radius:9px;
  background:var(--ui-surface-soft);
}
.stage-row-main{
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:7px;
  min-width:0;
}
.stage-status-form{
  display:flex;
  align-items:center;
  gap:6px;
}
.add-stage-form{
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(0,1fr) auto;
  gap:8px;
  margin-top:10px;
  align-items:end;
}
.object-edit-bottom{
  display:flex;
  justify-content:flex-start;
}
@media(max-width:760px){
  .simple-edit-form .two-field-grid,
  .add-stage-form{grid-template-columns:1fr}
  .object-photo-gallery{grid-template-columns:repeat(2,minmax(0,1fr))}
  .stage-row{grid-template-columns:1fr}
  .stage-status-form{width:100%}
  .stage-status-form select{flex:1}
}
@media(max-width:380px){
  .object-photo-gallery{grid-template-columns:1fr}
}

/* Stage 32: assignment editor */
.assignment-page-title{align-items:flex-start}
.assignment-editor-layout{
  display:grid;
  grid-template-columns:minmax(280px,360px) minmax(0,1fr);
  gap:12px;
  align-items:start;
}
.assignment-main-column,.assignment-selection-column{min-width:0}
.assignment-main-column .ui-section + .ui-section{margin-top:12px}
.assignment-section-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  margin-bottom:10px;
}
.assignment-section-head h2{margin:0}
.assignment-section-head p{margin:3px 0 0}
.assignment-basic-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
  margin-bottom:10px;
}
.assignment-basic-grid label:nth-child(2){grid-column:span 2}
.assignment-picker-section{margin:0 0 12px}
.assignment-picker-head input{width:min(280px,100%)}
.stage-object-picker-list,.tree-picker-list{display:grid;gap:9px}
.stage-object-choice,.object-tree-section{
  border:1px solid var(--ui-border);
  border-radius:10px;
  background:var(--ui-surface-soft);
  overflow:hidden;
}
.stage-object-heading,.object-tree-heading{
  display:flex;
  align-items:center;
  gap:9px;
  padding:10px;
}
.stage-object-heading>div,.object-tree-heading>div{min-width:0;flex:1}
.stage-object-heading img{
  width:54px;height:42px;object-fit:cover;border-radius:7px;flex:none;
}
.stage-object-heading h3,.object-tree-heading h3{margin:0}
.stage-object-heading p,.object-tree-heading p{margin:2px 0;font-size:12px}
.stage-object-heading small{font-size:11px;color:var(--ui-muted)}
.stage-task-choice-list,.tree-choice-list{
  display:grid;
  gap:6px;
  padding:0 8px 8px;
}
.stage-task-choice,.tree-choice{
  display:flex;
  align-items:center;
  gap:8px;
  min-width:0;
  padding:8px;
  border:1px solid var(--ui-border);
  border-radius:8px;
  background:var(--ui-surface);
}
.stage-task-choice>span,.tree-choice>span{min-width:0;flex:1}
.stage-task-choice small,.tree-choice small{
  display:block;
  margin-top:2px;
  color:var(--ui-muted);
  font-size:11px;
  overflow:hidden;text-overflow:ellipsis;
}
.tree-choice-photo{
  width:52px;height:42px;object-fit:cover;border-radius:6px;flex:none;
}
.assignment-save-bar{
  display:flex;
  justify-content:flex-end;
  gap:8px;
  margin-top:12px;
  padding:10px 0;
}
.assignment-notification-section,.pending-confirmation-section{margin-bottom:12px}
.assignment-notification-form{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:8px;
  align-items:end;
}
.assignment-notification-form textarea{grid-column:1}
.pending-stage-list{display:grid;gap:7px}
.pending-stage-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:9px 10px;
  border:1px solid var(--ui-border);
  border-radius:9px;
  background:var(--ui-surface-soft);
}
.pending-stage-row>div:first-child{min-width:0}
.pending-stage-row strong,.pending-stage-row span,.pending-stage-row small{display:block}
.pending-stage-row small{margin-top:3px;color:var(--ui-muted)}
.pending-stage-actions{display:flex;gap:7px;flex:none}
.pending-stage-actions form{margin:0}
.assignment-members-grid{display:grid;gap:7px}
@media(max-width:900px){
  .assignment-editor-layout{grid-template-columns:1fr}
  .assignment-main-column{display:grid;grid-template-columns:1fr 1fr;gap:10px}
  .assignment-main-column .ui-section + .ui-section{margin-top:0}
}
@media(max-width:680px){
  .assignment-main-column{grid-template-columns:1fr}
  .assignment-basic-grid{grid-template-columns:1fr}
  .assignment-basic-grid label:nth-child(2){grid-column:auto}
  .assignment-picker-head{flex-direction:column}
  .assignment-picker-head input{width:100%}
  .assignment-notification-form{grid-template-columns:1fr}
  .assignment-notification-form textarea{grid-column:auto}
  .pending-stage-row{align-items:flex-start;flex-direction:column}
  .pending-stage-actions{width:100%;flex-direction:column}
  .pending-stage-actions .button{width:100%}
  .assignment-save-bar{flex-direction:column-reverse}
  .assignment-save-bar .button{width:100%}
}
@media(max-width:420px){
  .stage-object-heading,.object-tree-heading{align-items:flex-start;flex-wrap:wrap}
  .stage-object-heading .button,.object-tree-heading .button{width:100%}
  .tree-choice-photo{width:46px;height:38px}
}

/* Stage 33: assignments list */
.assignments-page-title{align-items:flex-start}
.assignments-filters{margin-bottom:12px}
.assignment-filter-form{
  display:grid;
  grid-template-columns:180px 180px 180px auto;
  gap:9px;
  align-items:end;
}
.assignment-filter-form label{min-width:0}
.assignment-list{display:grid;gap:9px}
.assignment-list-card{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:12px;
  align-items:center;
}
.assignment-list-main{
  display:block;
  min-width:0;
  color:inherit;
  text-decoration:none;
}
.assignment-list-main:hover h2{text-decoration:underline}
.assignment-card-title h2{
  margin:2px 0 0;
  font-size:18px;
}
.assignment-date{
  color:var(--ui-muted);
  font-size:12px;
  font-weight:600;
}
.assignment-object-line{
  margin-top:8px;
  color:var(--ui-text);
  font-size:13px;
  line-height:1.4;
}
.assignment-task-summary{
  display:flex;
  flex-wrap:wrap;
  gap:7px;
  margin-top:9px;
}
.assignment-task-summary span{
  padding:5px 8px;
  border-radius:7px;
  background:var(--ui-surface-soft);
  font-size:12px;
}
.assignment-task-summary strong{margin-left:3px}
.assignment-meta{
  display:flex;
  flex-wrap:wrap;
  gap:5px 13px;
  margin-top:9px;
  color:var(--ui-muted);
  font-size:12px;
}
.assignment-meta b{color:var(--ui-text)}
.assignment-list-actions{display:flex;align-items:center}
.assignments-empty{text-align:center;padding:26px 15px}
.assignments-empty h2{margin:0 0 5px}
.assignments-empty p{margin:0 0 13px}
@media(max-width:800px){
  .assignment-filter-form{grid-template-columns:1fr 1fr}
  .assignment-filter-form button{width:100%}
  .assignment-list-card{grid-template-columns:1fr}
  .assignment-list-actions{justify-content:flex-start}
}
@media(max-width:500px){
  .assignment-filter-form{grid-template-columns:1fr}
  .assignment-card-title h2{font-size:16px}
  .assignment-task-summary{display:grid;grid-template-columns:1fr 1fr}
  .assignment-task-summary span{text-align:center}
  .assignment-list-actions .button{width:100%}
}

/* Stage 34: worker assignment final tree list / photo actions */
.worker-assignment-tree-list{
  margin-top:10px;
  padding-top:10px;
  border-top:1px solid var(--ui-border);
}
.worker-assignment-tree-list-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  margin-bottom:7px;
}
.worker-assignment-tree-items{
  display:grid;
  gap:6px;
}
.worker-assignment-tree-item{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:9px;
  padding:7px 8px;
  border:1px solid var(--ui-border);
  border-radius:8px;
  background:var(--ui-surface);
}
.worker-assignment-tree-main{
  display:flex;
  align-items:center;
  gap:8px;
  min-width:0;
}
.worker-tree-number{
  flex:none;
  min-width:34px;
  padding:4px 5px;
  border-radius:6px;
  background:var(--ui-surface-soft);
  font-weight:700;
  font-size:12px;
  text-align:center;
}
.worker-assignment-tree-main strong,
.worker-assignment-tree-main .muted{
  display:block;
  overflow:hidden;
  text-overflow:ellipsis;
}
.worker-assignment-tree-main .muted{
  margin-top:2px;
  font-size:11px;
}
.worker-tree-photo-link{
  position:relative;
  flex:none;
  width:64px;
  height:48px;
  overflow:hidden;
  border-radius:7px;
}
.worker-tree-photo-link img{
  display:block;
  width:100%;
  height:100%;
  object-fit:cover;
}
.worker-tree-photo-link span{
  position:absolute;
  left:3px;
  right:3px;
  bottom:3px;
  padding:3px 4px;
  border-radius:4px;
  background:rgba(0,0,0,.62);
  color:#fff;
  font-size:9px;
  text-align:center;
}
@media(max-width:520px){
  .worker-assignment-tree-item{align-items:flex-start}
  .worker-tree-photo-link{width:58px;height:44px}
}

/* Stage 36: registry */
.registry-filter-section{margin-bottom:12px}
.registry-filter-form{
  display:grid;
  grid-template-columns:minmax(180px,1fr) minmax(160px,220px) auto auto;
  gap:9px;
  align-items:end;
}
.registry-section-head{margin-bottom:12px}
.registry-section-head h2{margin:0}
.registry-section-head p{margin:3px 0 0}
.registry-object-list{display:grid;gap:8px}
.registry-object-group{margin:0}
.registry-object-group>summary{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
  padding:9px 11px;
  border:1px solid var(--ui-border);
  border-radius:9px;
  background:var(--ui-surface-soft);
  cursor:pointer;
  list-style:none;
}
.registry-object-group>summary::-webkit-details-marker{display:none}
.registry-object-group>summary span{display:flex;flex-direction:column;gap:2px}
.registry-object-group>summary small{color:var(--ui-muted);font-size:11px}
.registry-object-group-items{display:grid;gap:7px;margin-top:7px}
.registry-object-row{
  display:grid;
  grid-template-columns:minmax(260px,2fr) minmax(130px,.8fr) minmax(110px,.7fr) 70px 60px 20px;
  gap:10px;
  align-items:center;
  padding:9px 10px;
  border:1px solid var(--ui-border);
  border-radius:9px;
  background:var(--ui-surface);
  color:inherit;
  text-decoration:none;
}
.registry-object-row:hover{border-color:var(--ui-primary);transform:translateY(-1px)}
.registry-object-main{
  display:block;
  min-width:0;
}
.registry-object-main>div{min-width:0}
.registry-object-main strong,.registry-object-main span,.registry-object-main small{
  display:block;overflow:hidden;text-overflow:ellipsis;
}
.registry-object-main span{font-size:12px;margin-top:2px}
.registry-object-main small{font-size:11px;color:var(--ui-muted);margin-top:2px}
.registry-object-status{white-space:nowrap}
.registry-object-progress strong{font-size:12px}
.registry-object-progress .progress-track{margin-top:5px}
.registry-object-metric{text-align:center}
.registry-object-metric strong,.registry-object-metric span{display:block}
.registry-object-metric strong{font-size:16px}
.registry-object-metric span{font-size:10px;color:var(--ui-muted)}
.registry-object-arrow{text-align:center;font-size:18px;color:var(--ui-muted)}
.registry-empty{padding:22px;text-align:center}
.registry-empty strong{display:block;margin-bottom:3px}
.registry-empty p{margin:0}
.registry-tree-table-section{overflow:hidden}
.registry-tree-table td{vertical-align:middle}
.registry-table-empty{text-align:center!important;padding:20px!important}
@media(max-width:900px){
  .registry-filter-form{grid-template-columns:1fr 1fr}
  .registry-filter-form button,.registry-filter-form a{width:100%;text-align:center}
  .registry-object-row{
    grid-template-columns:minmax(0,1fr) auto;
  }
  .registry-object-status,.registry-object-progress{grid-column:auto}
  .registry-object-metric,.registry-object-arrow{display:none}
}
@media(max-width:600px){
  .registry-filter-form{grid-template-columns:1fr}
  .registry-object-row{grid-template-columns:1fr;padding:9px}
  .registry-object-status,.registry-object-progress{grid-column:1}
  .registry-object-status{margin-top:-2px}
  .registry-object-progress{max-width:240px}
  .registry-tree-table thead{display:none}
  .registry-tree-table,.registry-tree-table tbody,.registry-tree-table tr,.registry-tree-table td{
    display:block;width:100%;
  }
  .registry-tree-table tr{
    margin-bottom:8px;
    padding:9px;
    border:1px solid var(--ui-border);
    border-radius:9px;
    background:var(--ui-surface);
  }
  .registry-tree-table td{
    display:grid;
    grid-template-columns:125px minmax(0,1fr);
    gap:8px;
    padding:4px 0;
    border:0;
  }
  .registry-tree-table td::before{
    content:attr(data-label);
    color:var(--ui-muted);
    font-size:11px;
  }
  .registry-tree-table td:last-child{display:block;margin-top:5px}
  .registry-tree-table td:last-child::before{display:none}
  .registry-tree-table td:last-child .button{width:100%}
}

/* Stage 37: photo fixation */
.record-layout{
  display:grid;
  grid-template-columns:minmax(0,1.55fr) minmax(280px,.75fr);
  gap:12px;
  align-items:start;
}
.record-main,.record-side{min-width:0;display:grid;gap:12px}
.record-section-head{display:flex;justify-content:space-between;gap:10px;margin-bottom:10px}
.record-section-head h2{margin:0}
.record-section-head p{margin:3px 0 0}
.record-details{margin:0 0 12px}
.record-details dt,.record-details dd{padding:6px 0;border-bottom:1px solid var(--ui-border)}
.record-details dt:last-of-type,.record-details dd:last-of-type{border-bottom:0}
.record-gallery{margin:0}
.record-gallery figure{margin:0}
.record-gallery figcaption{display:grid;gap:2px}
.record-gallery figcaption a{font-size:11px}
.record-edit-form{display:grid;gap:9px}
.record-danger-action{margin-top:12px;padding-top:12px;border-top:1px solid var(--ui-border)}
.record-audit-section{margin-top:12px}
.record-create-page{max-width:900px;margin:0 auto}
.record-create-head{margin-bottom:12px}
.record-create-head h1{margin:0}
.record-create-head p{margin:4px 0 0}
.record-create-form{display:grid;gap:10px}
.record-create-step{
  padding:12px;
  border:1px solid var(--ui-border);
  border-radius:10px;
  background:var(--ui-surface);
}
.record-step-title{display:flex;gap:9px;align-items:flex-start;margin-bottom:10px}
.record-step-title>b{
  width:27px;height:27px;display:flex;align-items:center;justify-content:center;
  border-radius:50%;background:var(--ui-surface-soft);flex:none;
}
.record-step-title h2{margin:0;font-size:16px}
.record-step-title p{margin:2px 0 0}
.assignment-banner{margin-bottom:12px}
.assignment-banner strong{font-size:12px}
.assignment-banner h2{margin:3px 0}
.assignment-banner p{margin:0}
@media(max-width:800px){
  .record-layout{grid-template-columns:1fr}
  .record-side{order:-1}
}
@media(max-width:560px){
  .record-create-page{padding:11px}
  .record-create-step{padding:10px}
  .record-gallery{grid-template-columns:repeat(2,minmax(0,1fr))}
}

/* Stage 38: dashboard / trash / inspector */
.dashboard-stat-grid{
  display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:9px;margin-bottom:12px;
}
.dashboard-stat{
  display:block;padding:12px;border:1px solid var(--ui-border);border-radius:10px;
  background:var(--ui-surface);color:inherit;text-decoration:none;
}
.dashboard-stat:hover{border-color:var(--ui-primary)}
.dashboard-stat strong,.dashboard-stat span{display:block}
.dashboard-stat strong{font-size:23px;line-height:1.1}
.dashboard-stat span{margin-top:3px;color:var(--ui-muted);font-size:12px}
.dashboard-grid{
  display:grid;grid-template-columns:minmax(0,1fr) minmax(240px,310px);gap:12px;align-items:start;
}
.dashboard-main,.dashboard-side{display:grid;gap:12px}
.dashboard-attention-list{display:grid;gap:7px}
.dashboard-attention-list a{
  display:grid;gap:2px;padding:8px 9px;border:1px solid var(--ui-border);
  border-radius:8px;color:inherit;text-decoration:none;background:var(--ui-surface-soft);
}
.dashboard-attention-list a:hover{border-color:var(--ui-primary)}
.dashboard-attention-list span,.dashboard-attention-list small{color:var(--ui-muted);font-size:11px}
.dashboard-footnote{margin:10px 0 0}
.quick-actions{display:grid;gap:6px}
.quick-actions a{
  display:block;padding:8px 9px;border:1px solid var(--ui-border);border-radius:8px;
  color:inherit;text-decoration:none;background:var(--ui-surface-soft);
}
.quick-actions a:hover{border-color:var(--ui-primary)}
.trash-tabs{margin-bottom:12px}
.trash-tabs a{display:inline-block}
.inspector-page-title{align-items:flex-start}
.tree-create-page{max-width:760px;margin:0 auto}
.tree-create-step{
  margin-bottom:10px;padding:12px;border:1px solid var(--ui-border);
  border-radius:10px;background:var(--ui-surface);
}
.tree-create-step .compact-object-photo-picker{margin:0}
@media(max-width:900px){
  .dashboard-stat-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .dashboard-grid{grid-template-columns:1fr}
}
@media(max-width:560px){
  .dashboard-stat-grid{grid-template-columns:1fr 1fr}
  .dashboard-stat strong{font-size:20px}
}

/* Stage 42: unified tree photo gallery */
.tree-photo-gallery figure{position:relative}
.tree-photo-gallery figcaption{
  display:flex;align-items:center;justify-content:space-between;gap:6px;
  margin-top:4px;font-size:10px;color:var(--ui-muted);
}
.tree-photo-gallery figcaption a{font-size:10px}

.tree-photo-count{
  display:inline-flex;align-items:center;justify-content:center;
  min-width:22px;height:22px;padding:0 6px;margin-left:4px;
  border-radius:999px;font-size:11px;vertical-align:2px;
  background:var(--ui-surface-soft);color:var(--ui-muted);
}

/* Stage 47: force tree photo thumbnails to occupy a visible box */
.tree-photo-gallery figure{
  display:block;
  min-height:0;
}
.tree-photo-gallery a{
  display:block !important;
  width:100%;
  min-height:80px;
  background:#f1f4f2;
}
.tree-photo-gallery img{
  display:block !important;
  width:100% !important;
  height:auto !important;
  min-height:120px;
  aspect-ratio:4/3;
  object-fit:cover;
  visibility:visible !important;
  opacity:1 !important;
}

.tree-photo-missing{
  display:flex;align-items:center;justify-content:center;
  min-height:120px;border-radius:9px;
  background:#f1f4f2;color:var(--ui-muted);font-size:12px;
}


/* Stage 56: Leaflet maps must stay below the sticky header. */
.topbar{
    position:sticky !important;
    top:0 !important;
    z-index:10000 !important;
    isolation:isolate;
}
.map-card,
#trees-map{
    isolation:isolate;
}
.map-card{
    z-index:0 !important;
}
#trees-map{
    z-index:0 !important;
}


/* Stage 60: tree photo card shows only the image. */
.tree-photo-gallery figure > a:first-child{
  display:block !important;
  width:100%;
  overflow:hidden;
  border-radius:9px;
  background:#f1f4f2;
}
.tree-photo-gallery figure > a:first-child img{
  display:block !important;
  width:100% !important;
  height:auto !important;
  min-height:120px;
  aspect-ratio:4/3;
  object-fit:cover;
}


/* =========================================================
   Stage 73 — Unified WorkControl UI
   One visual system for objects, trees, forms, cards and maps.
   Keep functional selectors untouched; this layer only normalizes appearance.
   ========================================================= */

:root{
  --ui-bg:#f4f7f8;
  --ui-surface:#fff;
  --ui-surface-soft:#f8fafb;
  --ui-text:#20282f;
  --ui-muted:#71808b;
  --ui-border:#dfe6ea;
  --ui-primary:#79c900;
  --ui-primary-dark:#5d9e00;
  --ui-warning:#f0ad00;
  --ui-danger:#d9534f;
  --ui-radius:12px;
  --ui-radius-sm:9px;
  --ui-gap:12px;
  --ui-shadow:0 2px 10px rgba(25,45,55,.06);
  --ui-shadow-hover:0 4px 16px rgba(25,45,55,.09);
}

/* ---------- Page rhythm ---------- */
.page-title,
.object-page-header,
.tree-page-header{
  margin:0 0 14px;
}
.page-title h1,
.object-page-header h1,
.tree-page-header h1{
  font-size:clamp(22px,3vw,30px);
  line-height:1.15;
  font-weight:700;
}
.page-title p,
.object-page-header p,
.tree-page-header p{
  color:var(--ui-muted);
  margin:4px 0 0;
  line-height:1.4;
}

/* ---------- One card language ---------- */
.ui-section,
.card,
.form-section,
.object-location-box,
.compact-object-photo-picker,
.tree-card,
.object-card,
.panel{
  background:var(--ui-surface);
  border:1px solid var(--ui-border);
  border-radius:var(--ui-radius);
  box-shadow:var(--ui-shadow);
}

.ui-section,
.form-section,
.object-location-box,
.compact-object-photo-picker{
  padding:14px 16px;
  margin:0 0 12px;
}

.card{
  padding:14px 16px;
}

.ui-section > h2,
.form-section > h2,
.object-location-box > h2,
.compact-object-photo-picker h2{
  margin:0 0 9px;
  font-size:18px;
  line-height:1.25;
  font-weight:700;
}

/* Avoid cards inside cards looking like separate floating panels. */
.ui-section .ui-section,
.ui-section .form-section,
.card .card,
.card .panel,
.card .object-card,
.card .tree-card{
  box-shadow:none;
}

/* ---------- Forms ---------- */
form label,
.simple-edit-form label,
.registry-filter-form label{
  display:block;
  color:var(--ui-text);
  font-size:14px;
  font-weight:600;
  line-height:1.35;
  margin:0 0 11px;
}

input:not([type="checkbox"]):not([type="radio"]),
select,
textarea{
  width:100%;
  min-height:42px;
  margin-top:5px;
  padding:9px 11px;
  border:1px solid var(--ui-border);
  border-radius:var(--ui-radius-sm);
  background:#fff;
  color:var(--ui-text);
  outline:none;
  transition:border-color .15s ease,box-shadow .15s ease;
}

textarea{
  min-height:96px;
  resize:vertical;
}

input:not([type="checkbox"]):not([type="radio"]):focus,
select:focus,
textarea:focus{
  border-color:var(--ui-primary);
  box-shadow:0 0 0 3px rgba(121,201,0,.13);
}

/* ---------- Buttons ---------- */
.button,
button.button{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:6px;
  min-height:40px;
  padding:8px 13px;
  border:1px solid var(--ui-border);
  border-radius:var(--ui-radius-sm);
  background:#fff;
  color:var(--ui-text);
  font-weight:600;
  text-decoration:none;
  line-height:1.2;
  cursor:pointer;
  box-shadow:none;
  transition:background .15s ease,border-color .15s ease,transform .05s ease;
}

.button:hover,
button.button:hover{
  box-shadow:var(--ui-shadow-hover);
}

.button:active,
button.button:active{
  transform:translateY(1px);
}

.button-secondary{
  background:var(--ui-primary);
  border-color:var(--ui-primary);
  color:#fff;
}
.button-secondary:hover{
  background:var(--ui-primary-dark);
  border-color:var(--ui-primary-dark);
}

.button-light{
  background:var(--ui-surface-soft);
}

.button-danger{
  background:#fff4f3;
  border-color:#efc5c2;
  color:#b83e39;
}

.button-small{
  min-height:34px;
  padding:7px 10px;
  font-size:13px;
}

.button-large{
  min-height:44px;
  padding:10px 15px;
}

/* ---------- Location / GPS ---------- */
.object-location-box{
  margin-bottom:12px;
}

.location-controls{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}

.location-controls .button{
  flex:0 0 auto;
}

.geo-status{
  margin-top:9px;
  padding:8px 10px;
  border:1px solid var(--ui-border);
  border-radius:var(--ui-radius-sm);
  background:var(--ui-surface-soft);
  color:var(--ui-muted);
  font-size:13px;
  line-height:1.35;
}

/* ---------- Photo blocks ---------- */
.compact-object-photo-picker{
  margin-bottom:12px;
}

.compact-photo-actions{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}

.compact-photo-preview{
  display:grid;
  grid-template-columns:repeat(5,minmax(0,1fr));
  gap:7px;
  margin-top:10px;
}

.compact-photo-preview img,
.tree-edit-gallery img,
.tree-photo-gallery img{
  display:block;
  width:100%;
  aspect-ratio:1;
  object-fit:cover;
  border-radius:8px;
}

.tree-photo-gallery,
.tree-edit-gallery{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:8px;
}

.tree-photo-gallery figure,
.tree-edit-gallery figure{
  margin:0;
  min-width:0;
}

.tree-photo-gallery figure > a,
.tree-edit-gallery figure > a{
  display:block;
  overflow:hidden;
  border-radius:8px;
  background:var(--ui-surface-soft);
}

.object-photo-gallery{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:8px;
}

/* ---------- Details: same compact field/value rhythm everywhere ---------- */
.details{
  display:grid;
  grid-template-columns:minmax(120px,.42fr) minmax(0,1fr);
  margin:0;
  border-top:1px solid var(--ui-border);
}

.details dt,
.details dd{
  margin:0;
  padding:9px 0;
  border-bottom:1px solid var(--ui-border);
  line-height:1.4;
}

.details dt{
  color:var(--ui-muted);
  font-size:13px;
  font-weight:600;
  padding-right:14px;
}

.details dd{
  color:var(--ui-text);
  font-size:14px;
  min-width:0;
  overflow-wrap:anywhere;
}

/* Object summary fields use the exact same rhythm. */
.object-summary-card .object-details,
.object-summary-card .details{
  margin-top:0;
}

.object-summary-card .object-details > div,
.object-summary-card .object-details .record-row{
  border-bottom:1px solid var(--ui-border);
  padding:8px 0;
}

/* ---------- Lists ---------- */
.object-tree-list,
.tree-list,
.object-list{
  display:flex;
  flex-direction:column;
  gap:0;
}

.object-tree-list-row,
.tree-choice,
.assignment-tree-card{
  min-height:42px;
  padding:8px 0;
  border:0;
  border-bottom:1px solid var(--ui-border);
  border-radius:0;
  background:transparent;
  box-shadow:none;
}

.object-tree-list-row:last-child,
.tree-choice:last-child,
.assignment-tree-card:last-child{
  border-bottom:0;
}

/* ---------- Section headings ---------- */
.section-heading,
.compact-section-head,
.tree-edit-section-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:10px;
  margin-bottom:9px;
}

.section-heading h2,
.compact-section-head h2,
.tree-edit-section-head h2{
  margin:0;
}

.section-heading p,
.compact-section-head p,
.tree-edit-section-head p{
  margin:3px 0 0;
  color:var(--ui-muted);
  font-size:13px;
}

/* ---------- Maps ---------- */
.map-card,
.object-map-card,
.map-filter-card{
  overflow:hidden;
}

.object-trees-map,
#trees-map{
  width:100%;
  min-height:360px;
  border-radius:10px;
  overflow:hidden;
}

.map-toolbar,
.map-filters,
.object-actions,
.tree-actions,
.object-meta,
.object-toolbar,
.tree-toolbar{
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:8px;
  margin:0 0 10px;
  padding:0;
  background:transparent;
  border:0;
  box-shadow:none;
}

/* ---------- Statuses / badges ---------- */
.badge,
.workflow-badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:25px;
  padding:4px 8px;
  border-radius:999px;
  font-size:12px;
  font-weight:700;
  white-space:nowrap;
}

.muted{
  color:var(--ui-muted);
}

.alert{
  border-radius:var(--ui-radius-sm);
}

/* ---------- Registry ---------- */
.registry-tabs{
  display:flex;
  flex-wrap:wrap;
  gap:5px;
  margin:0 0 12px;
  padding:4px;
  border:1px solid var(--ui-border);
  border-radius:var(--ui-radius);
  background:var(--ui-surface);
}

.registry-tabs a{
  padding:8px 11px;
  border-radius:8px;
  color:var(--ui-muted);
  text-decoration:none;
  font-weight:600;
  font-size:13px;
}

.registry-tabs a.active{
  background:#edf5e6;
  color:#507f18;
}

/* ---------- Tree editor ---------- */
.tree-edit-layout{
  display:grid;
  grid-template-columns:minmax(0,1fr) 300px;
  gap:12px;
  align-items:start;
}

.tree-edit-main{
  min-width:0;
}

.tree-edit-side{
  min-width:0;
}

.tree-edit-actions{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-top:12px;
}

.tree-edit-note ul{
  margin:7px 0 0;
  padding-left:18px;
}

@media(max-width:900px){
  .tree-edit-layout{
    grid-template-columns:1fr;
  }
}

@media(max-width:768px){
  .ui-section,
  .form-section,
  .object-location-box,
  .compact-object-photo-picker,
  .card{
    padding:11px 12px;
    border-radius:10px;
  }

  .page-title h1,
  .object-page-header h1,
  .tree-page-header h1{
    font-size:23px;
  }

  .tree-photo-gallery,
  .tree-edit-gallery,
  .object-photo-gallery{
    grid-template-columns:repeat(3,minmax(0,1fr));
  }

  .compact-photo-preview{
    grid-template-columns:repeat(3,minmax(0,1fr));
  }

  .details{
    grid-template-columns:1fr;
  }

  .details dt{
    border-bottom:0;
    padding:8px 0 2px;
  }

  .details dd{
    padding:2px 0 8px;
  }

  .object-trees-map,
  #trees-map{
    min-height:300px;
  }
}

@media(max-width:430px){
  .location-controls,
  .compact-photo-actions{
    display:grid;
    grid-template-columns:1fr 1fr;
  }

  .location-controls .button,
  .compact-photo-actions .button{
    width:100%;
  }

  .tree-photo-gallery,
  .tree-edit-gallery,
  .object-photo-gallery{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }

  .compact-photo-preview{
    grid-template-columns:repeat(3,minmax(0,1fr));
  }
}


/* Stage 74 — registry: active/completed split and grouped-object emphasis */
.registry-view-switch{
  display:flex;
  flex-wrap:wrap;
  gap:7px;
  margin:0 0 12px;
  padding:4px;
  border:1px solid var(--ui-border);
  border-radius:var(--ui-radius);
  background:var(--ui-surface);
}

.registry-view-button{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:7px;
  min-height:38px;
  padding:8px 13px;
  border-radius:9px;
  color:var(--ui-muted);
  text-decoration:none;
  font-size:14px;
  font-weight:700;
}

.registry-view-button span{
  min-width:22px;
  padding:3px 6px;
  border-radius:999px;
  background:#edf5e6;
  color:#507f18;
  text-align:center;
  font-size:12px;
}

.registry-view-button.active{
  background:var(--ui-primary);
  color:#fff;
}

.registry-view-button.active span{
  background:rgba(255,255,255,.22);
  color:#fff;
}

.registry-view-button-completed.active{
  background:#71808b;
}

.registry-object-group-highlight{
  margin-bottom:10px;
  border:1px solid #cfe3ad;
  border-radius:12px;
  background:#fbfdf7;
  box-shadow:0 2px 12px rgba(93,158,0,.07);
}

.registry-object-group-highlight > summary{
  padding:11px 13px;
  background:#f0f7e8;
  border-radius:11px;
}

.registry-object-group-highlight > summary strong{
  color:#315d0d;
}

.registry-object-group-highlight > summary small{
  display:block;
  margin-top:3px;
  color:#66834c;
  font-size:12px;
}

.registry-object-group-highlight .registry-object-group-items{
  padding:0 8px 8px;
}

@media(max-width:600px){
  .registry-view-switch{
    display:grid;
    grid-template-columns:1fr 1fr;
  }

  .registry-view-button{
    width:100%;
    padding:8px 7px;
    font-size:13px;
  }

  .registry-object-group-highlight > summary{
    padding:10px 11px;
  }
}
