.debris-art{position:relative;width:min(100%,28rem);height:clamp(9rem,27vh,16rem);margin:auto;--row:0%}
.debris-art-1{--row:33.3333%}.debris-art-2{--row:66.6667%}.debris-art-3{--row:100%}
.debris-art span{position:absolute;width:36%;aspect-ratio:1.0625;background:url(debris-sprites.webp) var(--column) var(--row)/400% 400% no-repeat}
.debris-art span:nth-child(1){--column:0%;width:45%;left:26%;top:4%;z-index:1}
.debris-art span:nth-child(2){--column:33.3333%;width:27%;left:8%;top:43%;transform:rotate(17deg)}
.debris-art span:nth-child(3){--column:66.6667%;width:30%;right:5%;top:26%;transform:rotate(-14deg)}
.debris-art span:nth-child(4){--column:100%;width:20%;left:58%;top:62%;transform:rotate(12deg);z-index:2}
.debris-materials{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,13rem),1fr));gap:.65rem;margin-block:1rem}
.debris-materials label,.debris-quote{padding:.65rem .8rem;background:#14233e;border:1px solid #52739b;border-radius:10px}
.debris-materials progress{display:block;width:100%;margin-top:.3rem;accent-color:#8bdfef}
.debris-ship-list{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,15rem),1fr));gap:.5rem;margin-block:.7rem}
.debris-ship-list label{display:grid;grid-template-columns:minmax(0,1fr) 5rem;align-items:center;gap:.5rem}
.debris-ship-list input{width:100%;min-width:0}.debris-quote{margin-block:.7rem}
.debris-quote p{margin:.2rem 0}.debris-quote small{color:#bacce1}



.galaxy-debris-count{color:#b4efff!important;border-color:#52bad5!important}

.active-fleet-list{display:grid;gap:.6rem;margin-bottom:1rem}
.active-fleet-list .active-fleet-button{width:100%;display:flex;align-items:center;justify-content:space-between;gap:.75rem;padding:.7rem .9rem;text-align:left}
.active-fleet-button strong,.active-fleet-button small,.fleet-flight-progress small{display:block}
.active-fleet-button small{margin-top:.25rem;color:var(--muted,#bbcee3)}
.active-fleet-phase{color:#b4efff;text-align:right;flex-shrink:0;max-width:40%;white-space:normal}
.fleet-flight-facts{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,10rem),1fr));gap:.5rem}
.fleet-flight-facts div,.fleet-flight-progress{background:#13263b;border:1px solid #385776;border-radius:.6rem;padding:.6rem .8rem}
.fleet-flight-facts dt{font-size:.8rem;color:#b3c9e1}
.fleet-flight-facts dd{margin:0;font-weight:650}
.fleet-flight-progress small+small{margin-top:.35rem}

/* A real floating map popup; opening a debris field never replaces the map. */
.debris-map-popup[hidden]{display:none!important}
.debris-map-popup{
 position:absolute;z-index:8;left:50%;top:50%;transform:translate(-50%,-50%);
 width:min(455px,calc(100% - 20px));max-height:calc(100% - 22px);
 display:flex;flex-direction:column;min-height:0;overflow:hidden;
 border:1px solid #83cbe1;border-radius:15px;
 background:linear-gradient(150deg,#15394eed,#071827f5);
 backdrop-filter:blur(12px);
 box-shadow:0 14px 55px #000b,0 0 24px #42a9d366;
 color:#f0f9ff;
}
.debris-map-popup>header{
 display:flex;align-items:center;justify-content:space-between;gap:10px;
 padding:12px 14px;background:#163951e9;
 border-bottom:1px solid #6eb1d37a;
}
.debris-map-popup>header>div{display:grid;gap:5px}
.debris-map-popup>header small{font-size:10px;letter-spacing:.12em;color:#9bd6ed}
.debris-map-popup-title{font-size:20px;font-weight:800}
.debris-map-close{
 flex:none;min-height:36px;min-width:36px;padding:5px;
 background:#203e54;border:1px solid #8bcce3;border-radius:8px;
 color:#e9f9ff;cursor:pointer;font-size:18px;
}
.debris-map-popup-content{
 min-height:0;overflow:auto;overscroll-behavior:contain;
 padding:13px 15px 16px;touch-action:pan-y;
}
.debris-map-popup .debris-art{height:clamp(95px,15vh,140px)}
.debris-map-popup .debris-materials{margin-block:9px}
.debris-map-popup .debris-materials label{padding:9px;font-size:12px}
.debris-map-popup .actions{display:flex;flex-wrap:wrap;gap:7px}
.debris-lifetime{
 display:flex;flex-wrap:wrap;align-items:center;gap:6px 10px;
 padding:10px 12px;margin:9px 0;
 border-radius:9px;border:1px solid #c3a46d9a;
 background:linear-gradient(125deg,#313343,#183f52);
 color:#fff2c9;
}
.debris-lifetime>strong{font-weight:750}
.debris-lifetime [data-debris-expiry]{
 font-weight:800;font-variant-numeric:tabular-nums;font-size:16px;color:#fff;
}
.debris-lifetime small{display:block;width:100%;color:#c5deee;font-size:11px}
@media(max-width:760px){
 .debris-map-popup{width:calc(100% - 12px);max-height:calc(100% - 14px)}
 .debris-map-popup>header{padding:8px 10px}
 .debris-map-popup-content{padding:9px 11px 13px}
 .debris-map-popup .debris-art{height:100px}
 .debris-map-popup-title{font-size:16px}
}

/* Full-height floating wreck card: not clipped by the map or dialog body.
   The app re-parents the popup under #overlay when a field is opened. */
#overlay > .debris-map-popup {
 position:absolute;
 z-index:35;
 left:50%;
 top:50%;
 transform:translate(-50%,-50%);
 box-sizing:border-box;
 width:min(510px,calc(100vw - 24px));
 height:auto;
 max-height:calc(100dvh - 20px);
 max-height:calc(100svh - 20px);
 overflow:hidden;
}
#overlay > .debris-map-popup .debris-map-popup-content {
 flex:0 1 auto;
 overflow-y:auto; /* fallback only for genuinely tiny screens or long mission lists */
 padding:12px 15px 12px;
}
#overlay > .debris-map-popup .debris-art {
 height:clamp(95px,15dvh,150px);
}
#overlay > .debris-map-popup .debris-lifetime {
 margin:7px 0;
 padding:8px 10px;
}
#overlay > .debris-map-popup .debris-materials {
 margin:7px 0;
 gap:8px;
}
#overlay > .debris-map-popup .debris-materials label {
 padding:8px 9px;
}
#overlay > .debris-map-popup .debris-map-popup-content p {
 margin:5px 0;
}
#overlay > .debris-map-popup .debris-map-popup-content .actions {
 margin-top:9px;
}
@media (max-width:760px), (max-height:650px) {
 #overlay > .debris-map-popup {
  width:min(465px,calc(100vw - 12px));
  max-height:calc(100svh - 12px);
 }
 #overlay > .debris-map-popup > header {padding:8px 10px}
 #overlay > .debris-map-popup .debris-art {height:clamp(70px,12dvh,105px)}
 #overlay > .debris-map-popup .debris-map-popup-content {padding:8px 10px}
 #overlay > .debris-map-popup .debris-lifetime {padding:7px 9px}
 #overlay > .debris-map-popup .debris-materials {margin:5px 0}
 #overlay > .debris-map-popup .debris-materials label {padding:6px 8px}
}


/* v089: Bigger desktop information popup; use viewport height instead of
   wrapping it tightly around the previous tiny 192px sprite fragments. */
#overlay > .debris-map-popup {
 width:min(730px,calc(100vw - 24px));
 height:min(850px,calc(100svh - 20px));
 max-height:calc(100svh - 20px);
}
#overlay > .debris-map-popup > header {
 padding:16px 20px;
 min-height:58px;
 flex:none;
}
#overlay > .debris-map-popup .debris-map-popup-title {
 font-size:clamp(22px,2.4vw,30px);
}
#overlay > .debris-map-popup .debris-map-popup-content {
 flex:1 1 auto;
 min-height:0;
 display:flex;
 flex-direction:column;
 justify-content:space-around;
 overflow-y:auto;
 padding:12px 20px 18px;
}
#overlay > .debris-map-popup .debris-art.debris-art-hd {
 width:min(100%,590px);
 height:clamp(160px,32svh,320px);
 min-height:0;
 flex:1 1 180px;
 max-height:340px;
 display:flex;
 align-items:center;
 justify-content:center;
 margin:0 auto;
}
#overlay > .debris-map-popup .debris-art-hd img {
 display:block;
 width:100%;
 height:100%;
 object-fit:contain;
 image-rendering:auto;
 filter:drop-shadow(0 7px 18px #030b1a80);
}
#overlay > .debris-map-popup #debrisFieldDetail {
 display:flex;
 flex-direction:column;
 flex:1 1 auto;
 min-height:0;
 justify-content:space-around;
 gap:7px;
}
#overlay > .debris-map-popup .debris-materials {
 display:grid;
 grid-template-columns:repeat(2,minmax(0,1fr));
 gap:12px;
 margin:6px 0;
}
#overlay > .debris-map-popup .debris-materials label {
 padding:12px;
 min-width:0;
}
#overlay > .debris-map-popup .debris-lifetime {
 margin:6px 0;
 padding:12px 15px;
}
#overlay > .debris-map-popup .debris-map-popup-content .actions {
 margin:7px 0 0;
}
@media(max-width:760px), (max-height:650px) {
 #overlay > .debris-map-popup {
  width:min(550px,calc(100vw - 12px));
  height:min(700px,calc(100svh - 12px));
  max-height:calc(100svh - 12px);
 }
 #overlay > .debris-map-popup > header {padding:8px 12px;min-height:42px}
 #overlay > .debris-map-popup .debris-map-popup-title {font-size:19px}
 #overlay > .debris-map-popup .debris-map-popup-content {padding:8px 12px}
 #overlay > .debris-map-popup .debris-art.debris-art-hd {
  height:clamp(100px,25svh,195px);
  flex:1 1 110px;
 }
 #overlay > .debris-map-popup .debris-materials label {padding:7px 9px}
 #overlay > .debris-map-popup .debris-lifetime {padding:8px 10px}
}

/* v090: Stable vertical alignment when fleet estimates refresh. */
.overlay .dialog.debris-planner-dialog{
 height:min(680px,calc(100dvh - 32px));
 min-height:0;
 max-height:calc(100dvh - 32px);
 display:flex;
 flex-direction:column;
}
.overlay .dialog.debris-planner-dialog .dialog-header,
.overlay .dialog.debris-planner-dialog .dialog-footer{flex:0 0 auto}
.overlay .dialog.debris-planner-dialog .dialog-body{
 flex:1 1 auto;
 min-height:0;
 overflow-y:auto;
 overscroll-behavior:contain;
}
#debrisPlanner .debris-quote{
 position:relative;
 box-sizing:border-box;
 min-height:132px;
}
#debrisPlanner .debris-quote.is-calculating::after{
 content:"↻ Berechnung läuft …";
 position:absolute;
 right:9px;
 bottom:8px;
 padding:3px 7px;
 border-radius:5px;
 background:#253f55;
 color:#bde8fb;
 font-size:10px;
 pointer-events:none;
}
#debrisPlanner .debris-ship-list label{min-height:46px}
@media(max-width:760px){
 .overlay .dialog.debris-planner-dialog{
  height:min(680px,calc(100dvh - 12px));
  max-height:calc(100dvh - 12px);
 }
 #debrisPlanner .debris-quote{min-height:136px}
}


/* v093: Real server-authoritative salvage cargo with a compact live fill bar.
   The flight dialog refreshes the figures approximately every 10 seconds. */
.debris-cargo-fill{
 margin:10px 0 9px;
 display:grid;
 gap:6px;
}
.debris-cargo-fill-label{
 display:flex;
 justify-content:space-between;
 align-items:center;
 gap:10px;
 color:#b8d8eb;
 font-size:12px;
}
.debris-cargo-fill-label strong{
 color:#c8f8e7;
 font-variant-numeric:tabular-nums;
 font-size:13px;
}
.debris-cargo-fill-track{
 height:11px;
 border:1px solid #496d83;
 background:#0e2237;
 border-radius:50px;
 overflow:hidden;
}
.debris-cargo-fill-track span{
 display:block;
 height:100%;
 min-width:0;
 background:linear-gradient(90deg,#26a9c5,#6ce5b7);
 border-radius:50px;
 transition:width .55s ease;
}
@media(prefers-reduced-motion:reduce){
 .debris-cargo-fill-track span{transition:none}
}


/* v098: automatic recovery convoy, combined transport hold and mining rate. */
.debris-convoy-banner{
 margin:10px 0;
 padding:12px 14px;
 border:1px solid #6eb6bf99;
 border-radius:11px;
 background:linear-gradient(125deg,#153d51,#1a2649);
 display:grid;gap:7px;
}
.debris-convoy-banner strong{color:#b9fff1;font-size:14px}
.debris-convoy-banner small{color:#d6edf8;line-height:1.5}

/* v099: consolidated return overview, with each ship group still accounted for. */
.debris-convoy-returns{display:grid;gap:8px;margin:8px 0 14px}
.debris-convoy-returns>div{
  padding:10px 12px;border-radius:9px;border:1px solid #537996;
  background:linear-gradient(115deg,#132c43,#1d2442);
}
.debris-convoy-returns strong,.debris-convoy-returns small{display:block}
.debris-convoy-returns strong{color:#d9f6ff}
.debris-convoy-returns small{margin-top:3px;color:#b9d7e9}
