/* Inventory rows and pinned sale controls share the same compact mobile sheet. */
.world,#sheet-root{overflow:clip}
.resources-sheet,.production-sheet{height:min(580px,calc(100% - 142px))}
.resources-sheet .sheet-content,.production-sheet .sheet-content{display:flex;flex-direction:column;flex:1;min-height:0;overflow:clip;padding:0 18px}
.resources-sheet .tabs,.production-sheet .tabs{flex:0 0 auto;margin:0;min-height:44px}
.resources-sheet .tabs button,.production-sheet .tabs button{flex:1;justify-content:center;padding:8px;min-height:44px}
.resource-columns{display:grid;grid-template-columns:minmax(0,1.55fr) minmax(0,.8fr) minmax(0,.9fr);gap:8px;padding:2px 15px 7px;font-size:9px;letter-spacing:.7px;color:#96bad0;flex-shrink:0}
.resource-columns span:not(:first-child){text-align:right}
.resource-list{flex:1;min-height:0;overflow-y:auto;overflow-x:hidden;padding:0 0 6px;scrollbar-width:thin;overscroll-behavior:contain;touch-action:pan-y}
.resource-empty{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;min-height:130px;height:100%;padding:24px;text-align:center;color:#a5c5dd}
.resource-empty .icon{width:30px;height:30px;color:#6ae9df}
.resource-empty p{margin:0;max-width:260px;font-size:14px;line-height:1.5}
.resources-sheet .resource-row{display:grid;grid-template-columns:minmax(0,1.55fr) minmax(0,.8fr) minmax(0,.9fr);align-items:center;gap:8px;width:100%;height:52px;min-height:52px;padding:3px 15px 3px 8px;margin:0 0 5px;border:1px solid #6bbbd329;border-radius:28px;background:linear-gradient(110deg,#235270,#1c435e);box-shadow:0 2px 0 #020b1c99;color:#e1f3fd;text-align:left}
.resources-sheet .resource-row.selected{border-color:#38dcf3;background:linear-gradient(110deg,#2d627e,#258995);box-shadow:inset 0 0 0 1px #5be8ff39,0 0 10px #3deafa16}
@media(hover:hover) and (pointer:fine){.resources-sheet .resource-row:not(.selected):hover{border-color:#92afbf80}}
.resources-sheet .resource-name{display:flex;align-items:center;gap:8px;min-width:0;grid-column:auto}
.resources-sheet .resource-name strong{font-size:15px;font-weight:500;line-height:18px;overflow-wrap:normal}
.resource-badge{position:relative;flex:0 0 38px;width:38px;height:42px;display:grid;place-items:center}
.resources-sheet .resource-badge .resource-icon{width:38px;height:38px;flex:0 0 38px}
.resources-sheet .resource-badge small{position:absolute;bottom:0;left:50%;transform:translateX(-50%);padding:0 3px;border-radius:3px;line-height:12px;background:#d3e8e7;color:#12324b;font-size:9px;font-weight:700;white-space:nowrap}
.resource-stock,.resource-price{font-variant-numeric:tabular-nums;font-size:15px;line-height:20px;text-align:right;white-space:nowrap;font-weight:400}
.resource-price{display:flex;align-items:center;justify-content:flex-end;gap:3px}
.market-direction{color:#83e6ba;font-size:15px}
.market-direction.falling{color:#ff8e84}
.market-direction:empty{display:none}
.sale-tray{flex-shrink:0;margin:0 -18px;padding:8px 18px;background:#0a1126;border-top:1px solid #5285ad4a;box-shadow:0 -4px 16px #070c261a}
.resource-prompt{display:flex;align-items:center;justify-content:center;gap:8px;min-height:44px;color:#a5c5dd;font-size:14px}
.resource-prompt .icon{width:19px;height:19px;color:#6ae9df}
.sale-controls{display:grid;grid-template-columns:minmax(100px,1.35fr) minmax(64px,.9fr) 80px;align-items:center;gap:14px;min-height:57px}
.sale-slider-label{display:flex;flex-direction:column;gap:4px;min-width:0}
.sale-slider-label>span{display:flex;justify-content:space-between;gap:5px;font-size:11px;color:#a1c7da;line-height:14px;white-space:nowrap}
.sale-slider-label b{font-size:11px;color:#affaff;font-variant-numeric:tabular-nums}
#sale-percent{appearance:none;-webkit-appearance:none;width:100%;height:32px;margin:0;padding:0;background:transparent;cursor:ew-resize;touch-action:none;--sale-fill:100%}
#sale-percent::-webkit-slider-runnable-track{height:16px;border:1px solid #4b7d93;border-radius:10px;background:linear-gradient(to right,#27d9ef 0%,#18e0e6 var(--sale-fill),#030a17 var(--sale-fill),#030a17 100%)}
#sale-percent::-webkit-slider-thumb{appearance:none;-webkit-appearance:none;width:17px;height:30px;border:2px solid #e2ffff;border-radius:7px;background:#d4ffff;box-shadow:0 0 8px #5eeef54a;margin-top:-8px}
#sale-percent::-moz-range-track{height:16px;border:1px solid #4b7d93;border-radius:10px;background:#030a17}
#sale-percent::-moz-range-progress{height:16px;border-radius:10px;background:#22dce9}
#sale-percent::-moz-range-thumb{width:13px;height:26px;border:2px solid #e2ffff;border-radius:7px;background:#d4ffff}
.sale-preview{display:flex;flex-direction:column;gap:4px;min-width:0;font-variant-numeric:tabular-nums;white-space:nowrap;font-size:13px;line-height:17px;color:#adccdf}
.sale-preview strong{font-size:15px;color:#ecf9ff;font-weight:500}
.sale-controls .sale-button{min-height:44px;min-width:0;justify-content:center;font-size:15px;font-weight:600;border:2px solid #31d6ef;border-radius:23px;color:#efffff;background:linear-gradient(#17354a,#0c1c35);box-shadow:0 0 10px #2debf321;padding:4px 10px}
.sale-controls .sale-button:disabled{opacity:.35;box-shadow:none}
.sale-options{display:flex;justify-content:flex-end;align-items:center;gap:9px;min-height:31px;color:#789bb5;font-size:10px}
.sale-options select{height:28px;padding:2px 22px 2px 8px;font-size:10px;border:1px solid #588ca046;border-radius:6px;background-color:#10283b;color:#a9d9e5}
.resources-sheet button:focus-visible,#sale-percent:focus-visible,.recipe-modal button:focus-visible{outline:2px solid #b9faff;outline-offset:-2px}

/* Two compact lines per row; tabs do not scroll away with the cards. */
.production-scroll{flex:1;min-height:0;overflow:auto;overscroll-behavior:contain;touch-action:pan-y;scrollbar-width:thin;padding:8px 0 16px}
.production-sheet .production-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin:0;align-items:stretch}
.production-sheet .production-card,.production-sheet .add-production{display:flex;flex-direction:column;min-width:0;min-height:208px;padding:10px;border:1px solid #6dc3d44a;border-radius:19px;background:radial-gradient(ellipse at 70% 80%,#286b83,#183d59 90%);box-shadow:0 3px 0 #020816b0}
.production-sheet .card-eyebrow{display:flex;flex-direction:row;justify-content:space-between;gap:4px;font-size:8px;letter-spacing:.5px;line-height:12px;color:#9bc5d7}
.production-sheet .card-eyebrow>span:last-child{font-size:7px;letter-spacing:0;white-space:nowrap}
.production-sheet .recipe-flow,.recipe-modal .recipe-flow{display:flex;justify-content:center;align-items:center;gap:6px;flex:1;min-height:78px;margin:5px 0;min-width:0}
.production-sheet .recipe-inputs,.recipe-modal .recipe-inputs{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:4px;align-items:center;min-width:0;flex:1}
.recipe-inputs:has(>.recipe-ingredient:only-child){grid-template-columns:1fr}
.production-sheet .recipe-ingredient,.production-sheet .recipe-output,.recipe-modal .recipe-ingredient,.recipe-modal .recipe-output{display:flex;flex-direction:column;align-items:center;gap:0;min-width:0;font-size:10px;color:#c6e9ee;line-height:14px;white-space:nowrap}
.production-sheet .recipe-ingredient i{font-size:9px;color:#8ebacb;margin:0}
.production-sheet .recipe-output{flex:0 0 42px;font-size:11px}
.production-sheet .recipe-flow .resource-icon{height:36px;width:36px}
.production-sheet .recipe-flow>.icon,.recipe-modal .recipe-flow>.icon{flex:0 0 16px;width:16px;height:16px;color:#7fb4c8}
.production-sheet .production-card h3{font-size:12px;line-height:16px;font-weight:600;text-align:center;margin:0 0 4px;color:#d7f3f9}
.production-sheet .production-progress{display:flex;align-items:center;gap:5px;height:24px}
.production-sheet .progress{height:8px;flex:1;margin:0;border:1px solid #062034;background:#030e21;border-radius:6px;overflow:hidden}
.production-sheet .progress i{background:#26dcf1}
.production-sheet .stop-production{min-height:26px!important;width:27px;flex:0 0 27px;margin-right:-4px;padding:0;border:0;background:none;color:#7fb7ca;box-shadow:none}
.production-sheet .stop-production .icon{height:21px;width:21px}
.production-sheet .production-timer{display:block;text-align:center;font-size:10px;line-height:13px;min-height:13px;margin:0 0 6px;color:#a0c8d6}
.production-sheet .card-actions{margin-top:auto;gap:0;display:flex}
.production-sheet .card-actions .button,.production-sheet .add-production .button{min-height:34px;font-size:11px;padding:4px 7px;border:1.5px solid #3bdeee;border-radius:19px;background:#0c35554d;color:#dcfcff;justify-content:center}
.production-sheet .empty-recipe{flex:1;min-height:130px;margin:0;display:flex;flex-direction:column;justify-content:center;align-items:center;gap:8px}
.production-sheet .empty-recipe>.icon{height:35px;width:35px;color:#77cce1}
.production-sheet .add-production{justify-content:center;align-items:center;gap:12px}
.production-sheet .add-production>.icon{width:49px;height:49px;color:#25d7f0}
.production-sheet .add-production>.icon{padding:0;margin:0;border:0;border-radius:0;box-sizing:border-box}
.production-sheet .add-production h3{font-size:14px;color:#b9e1ea;margin:0}
.production-sheet .add-production .button{margin-top:6px;width:100%}

/* Recipe choices use the same ingredient artwork, instead of long text rows. */
dialog.recipe-modal{width:min(620px,calc(100vw - 24px));max-height:min(760px,calc(100dvh - 60px));padding:0;border:1px solid #6680ae78;border-radius:17px;background:linear-gradient(135deg,#1a3152,#14152e)}
.recipe-modal .modal-header{padding:12px 16px;min-height:60px}
.recipe-modal .modal-header .eyebrow{display:none}
.recipe-modal .modal-header h2{font-size:21px}
.recipe-modal .modal-body{padding:0 14px 14px}
dialog.recipe-modal[open]{display:flex;flex-direction:column;overflow:hidden}
.recipe-modal .modal-header{flex-shrink:0}
.recipe-modal .modal-body{overflow:auto;min-height:0;scrollbar-width:thin;overscroll-behavior:contain}
.recipe-modal .recipe-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}
.recipe-modal .recipe-option{display:flex;flex-direction:column;gap:3px;padding:12px 9px 8px;min-width:0;min-height:174px;border:1px solid #65abc346;border-radius:18px;background:radial-gradient(ellipse at 70% 85%,#266b82,#1a3e58 90%);box-shadow:0 3px 0 #050c1eb3;white-space:normal;text-align:center;color:#d7f4f6}
.recipe-modal .recipe-option-copy{display:flex;flex-direction:column;gap:3px}
.recipe-modal .recipe-option-copy strong{font-size:13px;line-height:17px;font-weight:600;color:#abe1e6}
.recipe-modal .recipe-option-copy small{font-size:12px;line-height:16px;color:#f3fcff}
.recipe-modal .recipe-flow{width:100%;min-height:74px;margin:7px 0 3px;gap:5px}
.recipe-modal .recipe-flow .resource-icon{width:38px;height:38px}
.recipe-modal .recipe-output{flex:0 0 40px}
.recipe-modal .recipe-choice{display:flex;align-items:center;justify-content:center;gap:4px;min-height:20px;font-size:10px;color:#8bdaea}
.recipe-modal .recipe-choice .icon{width:13px;height:13px}
.recipe-modal .recipe-option:disabled{opacity:.42}
.recipe-modal .recipe-option:hover:not(:disabled){border-color:#43e5ef;box-shadow:0 0 12px #54e2f230}
@media(max-width:760px),(max-height:500px) and (pointer:coarse){
  .resources-sheet,.production-sheet{height:min(57dvh,550px);max-height:calc(100dvh - 154px)}
  .resources-sheet .sheet-header,.production-sheet .sheet-header{min-height:44px;padding:3px 10px 3px 14px}
  .resources-sheet .sheet-header h2,.production-sheet .sheet-header h2{font-size:20px}
  .resources-sheet .sheet-content,.production-sheet .sheet-content{padding:0 9px}
  .resources-sheet .tabs,.production-sheet .tabs{min-height:42px}
  .resources-sheet .tabs button,.production-sheet .tabs button{font-size:15px;min-height:42px}
  .resource-columns{font-size:8px;letter-spacing:.2px;gap:5px;padding:1px 12px 6px}
  .resources-sheet .resource-row{height:47px;min-height:47px;padding:2px 12px 2px 5px;gap:5px;margin-bottom:4px}
  .resources-sheet .resource-name{gap:5px}
  .resources-sheet .resource-name strong{font-size:13px;line-height:15px}
  .resource-badge{width:32px;height:38px;flex-basis:32px}
  .resources-sheet .resource-badge .resource-icon{width:32px;height:32px;flex-basis:32px}
  .resource-stock,.resource-price{font-size:14px;line-height:17px;gap:1px}
  .market-direction{font-size:12px}
  .sale-tray{margin:0 -9px;padding:5px 12px}
  .sale-controls{gap:10px;grid-template-columns:minmax(94px,1.35fr) minmax(58px,.9fr) 72px;min-height:56px}
  .sale-controls .sale-button{font-size:13px}
  .sale-preview{font-size:12px}
  .sale-preview strong{font-size:13px}
  .sale-options{min-height:29px}
  .resource-prompt{min-height:45px;font-size:13px}
  .production-sheet .production-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}
  .production-sheet .production-card,.production-sheet .add-production{min-height:198px;padding:9px 8px 8px}
  .production-sheet .card-eyebrow{font-size:7px;gap:2px}
  .production-sheet .card-eyebrow>span:last-child{font-size:6px}
  .production-sheet .recipe-flow{min-height:65px;gap:4px;margin:3px 0}
  .production-sheet .recipe-flow .resource-icon{width:30px;height:30px}
  .production-sheet .recipe-ingredient{font-size:9px;line-height:11px}
  .production-sheet .recipe-ingredient i{font-size:8px}
  .production-sheet .recipe-output{flex-basis:36px;font-size:10px}
  .production-sheet .card-eyebrow{line-height:10px}
  .production-sheet .production-card h3{line-height:14px;margin-bottom:3px}
  .production-sheet .production-timer{line-height:12px;min-height:12px;margin-bottom:4px}
  .production-sheet .card-actions{padding-top:0}
  .recipe-modal .modal-header h2{font-size:19px}
  .recipe-modal .modal-header{min-height:54px;padding:8px 12px}
  .recipe-modal .modal-body{padding:0 9px 12px}
  .recipe-modal .recipe-option{min-height:166px;padding:10px 8px 7px}
  .recipe-modal .recipe-option-copy strong{font-size:12px}
  .recipe-modal .recipe-flow .resource-icon{width:33px;height:33px}
  .recipe-modal .recipe-flow{gap:4px}
  .recipe-modal .recipe-ingredient,.recipe-modal .recipe-output{font-size:10px}
}
@media(max-width:360px){
  .resources-sheet .resource-name strong{font-size:11px;line-height:14px}
  .resource-stock,.resource-price{font-size:12px}
  .resource-badge{width:29px;flex-basis:29px}
  .resources-sheet .resource-name{gap:3px}
  .resources-sheet .resource-badge .resource-icon{width:29px;height:29px}
  .sale-controls{gap:7px;grid-template-columns:minmax(88px,1.3fr) minmax(58px,.9fr) 62px}
  .sale-slider-label>span,.sale-slider-label b{font-size:10px}
  .production-sheet .recipe-flow .resource-icon{width:28px;height:28px}
  .production-sheet .recipe-ingredient{font-size:8px}
  .production-sheet .recipe-ingredient i{font-size:7px}
  .production-sheet .recipe-output{flex-basis:30px;font-size:9px}
  .production-sheet .recipe-inputs{gap:3px}
  .production-sheet .card-eyebrow{flex-direction:column;gap:0}
  .recipe-modal .recipe-option{padding:8px 5px;min-height:160px}
  .recipe-modal .recipe-flow .resource-icon{width:28px;height:28px}
  .recipe-modal .recipe-output{flex-basis:30px}
}
@media(max-height:500px) and (min-width:600px){
  .resources-sheet,.production-sheet{height:calc(100dvh - 74px);max-height:calc(100dvh - 74px);width:min(760px,100%);left:50%;transform:translateX(-50%)}
  .resources-sheet .sheet-header,.production-sheet .sheet-header{min-height:34px}
  .resources-sheet .sheet-header h2,.production-sheet .sheet-header h2{font-size:17px}
  .resources-sheet .tabs,.production-sheet .tabs,.resources-sheet .tabs button,.production-sheet .tabs button{min-height:35px;padding-top:3px;padding-bottom:3px}
  .production-sheet .production-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
  .sale-options{min-height:24px}
  .sale-controls{min-height:47px}
}
