/* Crafting Planner · BitCraft Tools */
.grind-calculator-panel [hidden]{display:none!important}
.grind-target-option{display:flex;align-items:center;gap:5px;min-width:0}
.grind-target-option>.grind-target-type-button{flex:1;min-width:0}
.grind-info{position:relative;display:inline-flex;align-items:center;justify-content:center;width:17px;height:17px;flex:0 0 17px;margin-left:6px;padding:0;border:1px solid #655b49;border-radius:50%;background:#1c1b17;color:#b9a989;font:650 11px/1 Inter,ui-sans-serif,system-ui;text-transform:none;letter-spacing:0;cursor:help;vertical-align:middle}
.grind-info-tooltip{display:none!important;position:fixed;z-index:10000;box-sizing:border-box;width:300px;max-width:calc(100vw - 24px);max-height:calc(100dvh - 24px);overflow-y:auto;overscroll-behavior:contain;padding:11px 13px;border:1px solid #605442;border-radius:8px;background:#191a16;color:#d8d1c5!important;box-shadow:0 8px 24px #0008;font:400 13px/1.55 Inter,ui-sans-serif,system-ui!important;text-align:left;text-transform:none!important;letter-spacing:0!important;white-space:normal;overflow-wrap:anywhere}
.grind-info-tooltip.is-open{display:block!important}
.grind-info:focus-visible{outline:2px solid #b99d6c;outline-offset:3px}
.grind-yield-note{margin:0;color:#92958c;font-size:12px;line-height:1.5}
.grind-yield-chances{font-size:12px;color:#aeb0a6;line-height:1.5}
.grind-yield-chances summary{cursor:pointer;color:#cbb992}
.grind-yield-chances p{margin:7px 0 0}
/* Use the same content width as the surrounding Holmgard tab panels. */
.grind-calculator-panel{width:100%;max-width:none;margin:0;min-width:0}
.grind-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:20px;margin:0 0 18px}
.grind-heading h2{margin:2px 0 6px;font-size:28px}
.grind-heading .muted{max-width:760px;margin:0}
.grind-live-badge{flex:0 0 auto;border:1px solid #3b3831;border-radius:999px;background:#181815;color:#aaa397;padding:7px 10px;font-size:11px;font-weight:650;white-space:nowrap}
.grind-shell{display:grid;grid-template-columns:minmax(320px,410px) minmax(0,1fr);gap:22px;align-items:start}
.grind-setup{position:sticky;top:18px;padding:20px;display:grid;gap:18px;min-width:0}
.grind-step{display:grid;gap:10px;padding-bottom:17px;border-bottom:1px solid #2d2c28}
.grind-step:last-of-type{padding-bottom:0;border-bottom:0}
.grind-step-head{display:flex;gap:10px;align-items:flex-start}
.grind-step-head>span{display:grid;place-items:center;width:25px;height:25px;flex:0 0 25px;border:1px solid #454039;border-radius:50%;background:#161614;color:#c9b07d;font-size:11px;font-weight:700}
.grind-step-head div{display:grid;gap:2px;min-width:0}
.grind-step-head strong{font-size:13px;color:#ddd6ca}
.grind-step-head strong em{font-style:normal;font-weight:600;color:#777b75;font-size:11px;margin-left:4px}
.grind-step-head small{color:#85877f;font-size:12px;line-height:1.45}
.grind-search-wrap{position:relative}
.grind-search-wrap input,.grind-quantity-field input,.grind-quantity-field select{width:100%;box-sizing:border-box;border:1px solid #37342f;border-radius:9px;background:#10110f;color:#e8e1d7;padding:11px 12px;font:inherit;font-size:13px;outline:none}
.grind-search-wrap input:focus,.grind-quantity-field input:focus,.grind-quantity-field select:focus{border-color:#756750;box-shadow:0 0 0 2px rgba(181,152,94,.08)}
.grind-suggestions{position:absolute;z-index:30;left:0;right:0;top:calc(100% + 5px);max-height:300px;overflow:auto;border:1px solid #3b3933;border-radius:10px;background:#171715;box-shadow:0 14px 34px rgba(0,0,0,.35);padding:5px}
.grind-suggestion{width:100%;display:flex;align-items:center;gap:9px;border:0;border-radius:7px;background:transparent;color:#d9d2c7;padding:8px;text-align:left;cursor:pointer;font:inherit}
.grind-suggestion:hover,.grind-suggestion:focus-visible{background:#22221f}
.grind-suggestion img,.grind-suggestion .grind-icon-fallback{width:34px;height:34px;flex:0 0 34px;object-fit:contain;border:1px solid #36332d;border-radius:7px;background:#0e0f0e}
.grind-icon-fallback{display:grid;place-items:center;color:#777;font-size:11px}
.grind-suggestion div{display:grid;gap:1px;min-width:0}
.grind-suggestion strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px}
.grind-suggestion span{color:#7d817a;font-size:11px}
.grind-selected-item{display:grid;grid-template-columns:42px minmax(0,1fr) 30px;align-items:center;gap:9px;border:1px solid #3b352e;border-radius:10px;background:#171713;padding:9px}
.grind-item-icon{width:42px;height:42px;display:grid;place-items:center;border:1px solid #38342d;border-radius:8px;background:#0d0e0d}
.grind-item-icon img{max-width:36px;max-height:36px}
.grind-selected-item>div:nth-child(2){display:grid;gap:2px;min-width:0}
.grind-selected-item strong{font-size:13px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.grind-selected-item span{font-size:11px;color:#888b84}
.grind-selected-item button{border:0;background:transparent;color:#73766f;font-size:20px;cursor:pointer}
.grind-quantity-field{display:grid;gap:6px}
.grind-quantity-field>span{font-size:11px;font-weight:650;color:#8f918b;text-transform:uppercase;letter-spacing:.08em}
.grind-quantity-field input,.grind-quantity-field select{font-size:17px;font-weight:650}
.grind-player-chips{display:flex;gap:6px;flex-wrap:wrap}
.grind-player-chip{border:1px solid #34322d;border-radius:999px;background:#121310;color:#8f918a;padding:7px 10px;font:inherit;font-size:11px;font-weight:650;cursor:pointer}
.grind-player-chip.is-active{border-color:#665842;background:#1d1a15;color:#e0d5c4}
.grind-selected-player{border:1px solid #34332e;border-radius:9px;background:#131411;padding:9px 10px;display:flex;align-items:center;justify-content:space-between;gap:10px}
.grind-selected-player strong{font-size:12px}
.grind-selected-player span{font-size:11px;color:#858880}
.grind-selected-player button{border:0;background:transparent;color:#7d8079;cursor:pointer;font-size:17px}
.grind-calculate-button{width:100%;min-height:43px;font-weight:700}
.grind-message{min-height:16px;margin:0;color:#9a817d;font-size:12px;line-height:1.4}
.grind-results{display:grid;gap:12px;min-width:0}
.grind-empty{min-height:190px;display:grid;align-content:center;gap:8px;padding:26px}
.grind-empty strong{font-size:18px}
.grind-empty p{margin:0;max-width:620px;color:#858880;font-size:12px;line-height:1.55}
.grind-summary{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:14px;align-items:center;padding:14px 16px}
.grind-summary-main{display:flex;align-items:center;gap:11px;min-width:0}
.grind-summary-main .grind-item-icon{width:46px;height:46px;flex:0 0 46px}
.grind-summary-main div{display:grid;gap:2px;min-width:0}
.grind-summary-main strong{font-size:16px}
.grind-summary-main span{font-size:11px;color:#83867f}
.grind-summary-player{text-align:right;display:grid;gap:2px}
.grind-summary-player strong{font-size:12px;color:#d6cdc1}
.grind-summary-player span{font-size:11px;color:#82857e}
.grind-route{padding:0;overflow:visible}
.grind-route-head{display:flex;justify-content:space-between;align-items:flex-start;gap:14px;padding:15px 16px;border-bottom:1px solid #2c2b27}
.grind-route-title{display:grid;gap:4px;min-width:0}
.grind-route-title>span{font-size:11px;font-weight:700;letter-spacing:.1em;text-transform:uppercase;color:#777b74}
.grind-route-title strong{font-size:17px;color:#e0d8cc}
.grind-route-title small{font-size:11px;color:#858880}
.grind-route-crafts{text-align:right;display:grid;gap:2px;flex:0 0 auto}
.grind-route-crafts strong{font-size:18px;color:#d4bd88}
.grind-route-crafts span{font-size:11px;text-transform:uppercase;letter-spacing:.08em;color:#777a74}
.grind-xp-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));border-bottom:1px solid #2c2b27}
.grind-xp-cell{padding:13px 16px;display:grid;gap:3px}
.grind-xp-cell+.grind-xp-cell{border-left:1px solid #2c2b27}
.grind-xp-cell span{font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.08em;color:#777b74}
.grind-xp-cell strong{font-size:20px;color:#e3ddd3}
.grind-xp-cell small{font-size:11px;color:#83877f}
.grind-projection{margin:0 16px 14px;padding:9px 11px;border:1px solid #34322d;border-radius:8px;background:#151612;display:flex;justify-content:space-between;gap:10px;align-items:center}
.grind-projection span{font-size:11px;color:#858880}
.grind-projection strong{font-size:12px;color:#d8d0c4}
.grind-output-section{padding:14px 16px;display:grid;gap:10px}
.grind-output-head{display:flex;justify-content:space-between;gap:10px;align-items:baseline}
.grind-output-head strong{font-size:11px;text-transform:uppercase;letter-spacing:.08em;color:#aaa69d}
.grind-output-head span{font-size:11px;color:#777b75}
.grind-output-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:7px}
.grind-output{display:grid;grid-template-columns:38px minmax(0,1fr);gap:8px;align-items:center;border:1px solid #312f2a;border-radius:8px;background:#131411;padding:8px}
.grind-output img,.grind-output .grind-icon-fallback{width:36px;height:36px;object-fit:contain;border-radius:6px;background:#0d0e0d}
.grind-output div{display:grid;gap:1px;min-width:0}
.grind-output strong{font-size:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.grind-output span{font-size:11px;color:#d1b77d;font-weight:650}
.grind-other-inputs{padding:0 16px 15px}
.grind-other-inputs details{border-top:1px solid #292824;padding-top:10px}
.grind-other-inputs summary{cursor:pointer;color:#888b84;font-size:11px;font-weight:650}
.grind-other-input-list{display:flex;flex-wrap:wrap;gap:5px;margin-top:8px}
.grind-other-input-list span{border:1px solid #2f2e2a;border-radius:999px;background:#111210;color:#898c85;padding:5px 8px;font-size:11px}
.grind-disclaimer{padding:10px 14px;border:1px solid #302f2b;border-radius:9px;background:#121310;color:#7e817b;font-size:12px;line-height:1.5}
.grind-loading{padding:26px;text-align:center;color:#8b8e87}
@media(max-width:900px){
  .grind-heading{display:grid}
  .grind-live-badge{justify-self:start}
  .grind-shell{grid-template-columns:1fr}
  .grind-setup{position:static}
}
@media(max-width:560px){
  .grind-heading h2{font-size:24px}
  .grind-summary{grid-template-columns:1fr}
  .grind-summary-player{text-align:left}
  .grind-route-head{display:grid}
  .grind-route-crafts{text-align:left}
  .grind-xp-grid{grid-template-columns:1fr}
  .grind-xp-cell+.grind-xp-cell{border-left:0;border-top:1px solid #2c2b27}
  .grind-output-grid{grid-template-columns:1fr}
}


/* grind-reverse-planner-v2 */
.grind-mode-toggle,
.grind-target-type{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:4px;
  padding:4px;
  border:1px solid #34322d;
  border-radius:10px;
  background:#10110f;
}
.grind-mode-button,
.grind-target-type-button{
  min-height:38px;
  border:0;
  border-radius:7px;
  background:transparent;
  color:#858880;
  font:inherit;
  font-size:12px;
  font-weight:650;
  cursor:pointer;
}
.grind-mode-button:hover,
.grind-target-type-button:hover{
  color:#d5cec3;
  background:#1a1a17;
}
.grind-mode-button.is-active,
.grind-target-type-button.is-active{
  color:#efe6d8;
  background:rgba(185,157,108,.11);
  box-shadow:inset 0 0 0 1px rgba(185,157,108,.28);
}
.grind-target-controls{
  display:grid;
  gap:10px;
}
.grind-target-controls[hidden]{display:none!important}
.grind-target-hint{
  margin:0;
  color:#7f837b;
  font-size:11px;
  line-height:1.45;
}
.grind-collection-plan{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  margin:14px 16px 0;
  padding:13px 14px;
  border:1px solid #4c4232;
  border-radius:10px;
  background:linear-gradient(135deg,rgba(185,157,108,.10),rgba(185,157,108,.025));
}
.grind-collection-main{
  display:grid;
  grid-template-columns:44px minmax(0,1fr);
  gap:10px;
  align-items:center;
  min-width:0;
}
.grind-collection-main>img,
.grind-collection-main>.grind-icon-fallback{
  width:42px;
  height:42px;
  object-fit:contain;
  border:1px solid #42392d;
  border-radius:8px;
  background:#0e0f0e;
}
.grind-collection-main>div{
  display:grid;
  gap:2px;
  min-width:0;
}
.grind-collection-main span{
  color:#9b8d73;
  font-size:11px;
  font-weight:700;
  letter-spacing:.09em;
}
.grind-collection-main strong{
  color:#eee4d4;
  font-size:19px;
  line-height:1.15;
}
.grind-collection-main small{
  color:#888b84;
  font-size:11px;
  line-height:1.4;
}
.grind-plan-overage{
  flex:0 0 auto;
  max-width:220px;
  color:#a8a092;
  font-size:11px;
  line-height:1.35;
  text-align:right;
}
.grind-route-metrics{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  border-top:1px solid #2b2a26;
  border-bottom:1px solid #2b2a26;
  background:#141512;
}
.grind-route-metrics>div{
  display:grid;
  gap:3px;
  padding:11px 13px;
  min-width:0;
}
.grind-route-metrics>div+div{border-left:1px solid #2b2a26}
.grind-route-metrics span{
  color:#777b74;
  font-size:11px;
  font-weight:650;
  text-transform:uppercase;
  letter-spacing:.06em;
}
.grind-route-metrics strong{
  color:#d8d1c6;
  font-size:14px;
  overflow:hidden;
  text-overflow:ellipsis;
}
@media(max-width:720px){
  .grind-collection-plan{
    display:grid;
  }
  .grind-plan-overage{
    max-width:none;
    text-align:left;
  }
  .grind-route-metrics{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
  .grind-route-metrics>div:nth-child(3){
    border-left:0;
    border-top:1px solid #2b2a26;
  }
  .grind-route-metrics>div:nth-child(4){
    border-top:1px solid #2b2a26;
  }
}
@media(max-width:430px){
  .grind-mode-toggle,
  .grind-target-type{
    grid-template-columns:1fr;
  }
  .grind-route-metrics{
    grid-template-columns:1fr;
  }
  .grind-route-metrics>div+div{
    border-left:0;
    border-top:1px solid #2b2a26;
  }
}

/* Expandable recipe drop rates */
button.grind-output{color:inherit;font:inherit;text-align:left;cursor:pointer}
button.grind-output:hover{border-color:#75634a;background:#1b1b16}
button.grind-output:focus-visible{outline:2px solid #b99d6c;outline-offset:3px}
.grind-drop-table{width:100%;border-collapse:collapse;table-layout:fixed;margin-top:10px;font-size:12px}
.grind-drop-table caption{text-align:left;padding:0 0 10px;color:#92958c;font-size:11px;line-height:1.5}
.grind-drop-table th,.grind-drop-table td{padding:11px 8px;border-top:1px solid #34322d;text-align:left;vertical-align:middle}
.grind-drop-table thead th{color:#92958c;font-size:11px;font-weight:700}
.grind-drop-table th:first-child{width:72px}
.grind-drop-chance{display:inline-block;color:#d4bd88;font-weight:650;font-size:14px}
.grind-drop-items{display:flex;flex-wrap:wrap;gap:7px}
.grind-drop-items .grind-output{flex:1 1 140px;min-width:0;max-width:230px}
.grind-drop-items .grind-output strong{white-space:normal}
@media(max-width:520px){
  .grind-drop-table th:first-child{width:49px}
  .grind-drop-table th,.grind-drop-table td{padding:9px 5px}
  .grind-drop-items .grind-output{flex-basis:100%;max-width:none}
}

.grind-plan-metrics{grid-template-columns:repeat(2,minmax(0,1fr))}
.grind-time-note{margin:0;padding:9px 16px;color:#92958c;font-size:11px;line-height:1.5;border-bottom:1px solid #2c2b27}

.grind-target-type{grid-template-columns:repeat(3,minmax(0,1fr))}
.grind-manual-level{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.grind-target-type-button{font-size:11px}
.grind-target-option{gap:1px}
.grind-target-option .grind-info{margin-left:2px}
@media(max-width:430px){.grind-target-type{grid-template-columns:1fr}}

.grind-collection-plan .grind-other-input-list>strong{flex-basis:100%;font-size:12px;color:#bdb6a9}

.grind-gathering-controls{display:grid;gap:10px;padding:12px;border:1px solid #37342f;border-radius:9px;background:#121310}
.grind-gathering-toggle{display:flex;align-items:center;gap:9px;font-size:12px;color:#ccc5b8;cursor:pointer}
.grind-gathering-toggle input{width:17px;height:17px;margin:0;flex:0 0 17px;accent-color:#b99d6c}
.grind-gathering-toggle:has(input:disabled){opacity:.6}
.grind-gathering-breakdown{margin:0 16px 16px;padding:13px;border:1px solid #4b4232;border-radius:9px;background:#171712;color:#c6bdac}
.grind-gathering-breakdown>strong{font-size:14px}
.grind-gathering-breakdown p{font-size:12px;line-height:1.5;color:#919187;margin:8px 0 0}
.grind-gathering-breakdown table{width:100%;border-collapse:collapse;margin-top:10px;font-size:12px}
.grind-gathering-breakdown caption{text-align:left;font-size:11px;color:#929286;margin-bottom:6px}
.grind-gathering-breakdown td{padding:7px 4px;border-bottom:1px solid #333127;overflow-wrap:anywhere}
.grind-gathering-breakdown td:last-child{text-align:right;white-space:nowrap;color:#d1bd87}
.grind-gathering-breakdown tr:last-child td{font-weight:700;border-bottom:0}
@media(max-width:430px){.grind-gathering-breakdown{margin:0 10px 12px;padding:10px}.grind-gathering-breakdown table{font-size:11px}}

.grind-gathering-breakdown table{table-layout:fixed}
.grind-gathering-breakdown th{padding:7px 4px;text-align:left;color:#929286;font-size:11px;font-weight:600;overflow-wrap:anywhere}
.grind-gathering-breakdown th:nth-child(n+3),.grind-gathering-breakdown td:nth-child(n+3){text-align:right}
.grind-gathering-breakdown tbody tr:last-child td{font-weight:700;border-bottom:0}
@media(max-width:430px){.grind-gathering-breakdown th{font-size:10px}.grind-gathering-breakdown td:last-child{white-space:normal}}


/* Full recipe dependency plans */
.grind-dependency-plan{overflow:hidden}
.grind-dependency-heading{padding:18px 18px 14px;display:grid;gap:7px}
.grind-dependency-heading>.detail-label{font-size:10px;letter-spacing:.12em;color:#c6ab77}
.grind-dependency-heading>strong{font-size:clamp(18px,2.5vw,24px);color:#ece3d1;line-height:1.2}
.grind-dependency-heading>p{margin:0;color:#9d9d94;font-size:12px;line-height:1.6}
.grind-dependency-section{padding:18px;border-top:1px solid #34302a;display:grid;gap:12px}
.grind-dependency-section-head{display:flex;align-items:flex-start;gap:10px}
.grind-dependency-section-head>div{display:grid;gap:3px;min-width:0}
.grind-dependency-section-head strong{font-size:14px;color:#e8dfcd}
.grind-dependency-section-head small{font-size:11px;color:#96968c;line-height:1.5}
.grind-dependency-number{display:grid;place-items:center;flex:0 0 28px;height:28px;border:1px solid #64573b;border-radius:50%;color:#d7bc85;font-size:11px;font-weight:650;background:#27251f}
.grind-dependency-raw{margin:0;display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,185px),1fr));gap:8px}
.grind-dependency-raw .grind-output{min-width:0}
.grind-dependency-steps{list-style:none;margin:0;padding:0;display:grid;gap:8px}
.grind-dependency-steps li{display:flex;align-items:center;gap:11px;min-width:0;padding:11px;border-radius:10px;border:1px solid #34332c;background:#191a16}
.grind-dependency-step-number{flex:0 0 25px;display:grid;place-items:center;width:25px;height:25px;border-radius:50%;color:#e5c992;background:#343025;font-weight:650;font-size:11px}
.grind-dependency-steps li>img,.grind-dependency-steps li>.grind-icon-fallback{width:34px;height:34px;object-fit:contain;flex:0 0 34px}
.grind-dependency-step-copy{display:grid;gap:3px;min-width:0}
.grind-dependency-step-copy strong{color:#e1d8c9;font-size:13px;overflow-wrap:anywhere}
.grind-dependency-step-copy span{color:#99978d;font-size:11px;line-height:1.5}
.grind-dependency-tree{display:grid;gap:8px}
.grind-dependency-node{min-width:0;border:1px solid #353329;border-radius:10px;background:#171814;overflow:hidden}
.grind-dependency-node-head{display:flex;align-items:center;gap:10px;padding:10px;min-width:0;list-style:none}
summary.grind-dependency-node-head{cursor:pointer}
summary.grind-dependency-node-head:hover{background:#25241e}
summary.grind-dependency-node-head::-webkit-details-marker{display:none}
summary.grind-dependency-node-head:before{content:'▸';color:#cbb583;font-size:12px;margin-right:2px}
details[open] > summary.grind-dependency-node-head:before{content:'▾'}
.grind-dependency-node-head>img,.grind-dependency-node-head>.grind-icon-fallback{height:31px;width:31px;object-fit:contain;flex:0 0 31px}
.grind-dependency-node-copy{min-width:0;flex:1;display:grid;gap:3px}
.grind-dependency-node-copy strong{color:#dcd4c7;font-size:12px;overflow-wrap:anywhere}
.grind-dependency-node-copy small{color:#97968b;font-size:11px;line-height:1.4}
.grind-dependency-type{color:#a99161;background:#28251e;border-radius:5px;font-size:9px;font-weight:650;padding:4px 6px;letter-spacing:.07em}
.grind-dependency-node.is-raw{border-color:#384039;background:#191e1a}
.grind-dependency-node.is-raw .grind-dependency-type{color:#a4c5ab;background:#28362a}
.grind-dependency-node.is-shared{opacity:.8}
.grind-dependency-children{display:grid;gap:8px;margin:0 9px 10px 18px;padding-left:10px;border-left:2px solid #4b4131}
.grind-dependency-choice{display:grid;gap:6px;margin:0 10px 10px;padding:10px;border-radius:8px;background:#23231d}
.grind-dependency-choice>span{font-size:10px;text-transform:uppercase;letter-spacing:.07em;font-weight:650;color:#b8ae9d}
.grind-dependency-choice select{width:100%;min-width:0;min-height:37px;border:1px solid #645638;border-radius:7px;color:#e4d9c5;background:#151610;padding:8px;font-size:12px}
.grind-dependency-choice select:focus-visible{outline:2px solid #cdb37e;outline-offset:2px}
.grind-dependency-warning{border:1px solid #976c4e;border-radius:8px;padding:10px;margin:0;color:#e4b69a;background:#2a201a;font-size:12px}
.grind-dependency-section>.grind-yield-note{margin:0;color:#a39a89;font-size:11px;line-height:1.5}
@media(max-width:560px){
 .grind-dependency-heading{padding:14px}
 .grind-dependency-section{padding:13px}
 .grind-dependency-children{margin-left:8px;padding-left:8px}
 .grind-dependency-node-head{gap:7px;padding:8px}
 .grind-dependency-node-head>img,.grind-dependency-node-head>.grind-icon-fallback{width:26px;height:26px;flex-basis:26px}
 .grind-dependency-type{padding:3px 5px;font-size:8px}
}

/* New-player crafting guide: material sources and per-step ingredients */
.grind-dependency-source-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,260px),1fr));gap:10px}
.grind-dependency-source-card{display:grid;align-content:start;gap:8px;padding:10px;border:1px solid #40382c;border-radius:10px;background:#1a1b16;min-width:0}
.grind-dependency-source-card .grind-dependency-material-header>.grind-output{border:0;padding:5px 3px;background:transparent;min-width:0;flex:1 1 auto}
.grind-dependency-source-heading{color:#dec394;font-size:11px;line-height:1.45;overflow-wrap:anywhere}
.grind-dependency-source-options{display:grid;gap:5px}
.grind-dependency-source-line{display:flex;justify-content:space-between;align-items:baseline;gap:9px;border-top:1px solid #37362d;padding-top:6px;font-size:11px}
.grind-dependency-source-line>span{color:#c8c1b0;overflow-wrap:anywhere;min-width:0}
.grind-dependency-source-line>strong{color:#d2d6c3;text-align:right;font-weight:650;flex:0 1 50%;font-size:10px}
.grind-dependency-event-note{font-size:11px;line-height:1.55;color:#b0a694;margin:0;padding-top:6px;border-top:1px dashed #454035;overflow-wrap:anywhere}
.grind-dependency-step-ingredients{display:flex;align-items:center;flex-wrap:wrap;gap:5px;margin-top:7px}
.grind-dependency-step-ingredients>span:first-child{font-weight:650;color:#d6c3a1;font-size:11px;margin-right:2px}
.grind-dependency-step-ingredient{display:inline-flex;align-items:center;gap:5px;min-width:0;border:1px solid #484132;border-radius:5px;padding:4px 6px;background:#26251e}
.grind-dependency-step-copy .grind-dependency-step-ingredient>span{color:#d6ccb9;font-size:11px}
.grind-dependency-step-ingredient>img,.grind-dependency-step-ingredient>.grind-icon-fallback{width:18px;height:18px;object-fit:contain;flex:0 0 18px}
@media(max-width:560px){.grind-dependency-source-grid{grid-template-columns:1fr}.grind-dependency-source-line{align-items:flex-start}}

/* Discoverable biomes: compact hint on the card + accessible item-icon modal */
.grind-dependency-quick-biomes{margin:0;padding:6px 8px;border-radius:6px;background:#25291f;color:#c0d2bc;font-size:11px;line-height:1.5;overflow-wrap:anywhere}
.grind-dependency-quick-biomes.is-unknown{background:transparent;border:1px dashed #444033;color:#aaa18f}
.grind-gatherable-icon-btn{display:grid;place-items:center;appearance:none;border:1px solid #62583c;border-radius:8px;background:#26251e;padding:2px;width:38px;height:38px;cursor:pointer;flex:0 0 auto;transition:background .12s,border-color .12s,transform .12s}
.grind-gatherable-icon-btn:hover{background:#393221;border-color:#c6a66c;transform:translateY(-1px)}
.grind-gatherable-icon-btn:focus-visible{outline:2px solid #d9be8b;outline-offset:3px}
.grind-gatherable-icon-btn img,.grind-gatherable-icon-btn .grind-icon-fallback{width:32px;height:32px;max-width:100%;max-height:100%;object-fit:contain;border-radius:5px}
.grind-dependency-node-head>.grind-gatherable-icon-btn{width:33px;height:33px;flex:0 0 33px}
.grind-dependency-node-head>.grind-gatherable-icon-btn img,.grind-dependency-node-head>.grind-gatherable-icon-btn .grind-icon-fallback{width:29px;height:29px}
.grind-biome-dialog{box-sizing:border-box;width:min(94vw,640px);max-width:94vw;max-height:min(90dvh,780px);overflow:auto;padding:0;background:#171914;color:#e4ddcf;border:1px solid #66563a;border-radius:16px;box-shadow:0 18px 65px #000b}
.grind-biome-dialog::backdrop{background:rgba(4,7,6,.78);backdrop-filter:blur(5px)}
.grind-biome-dialog-inner{padding:18px;display:grid;gap:13px}
.grind-biome-dialog-header{display:flex;align-items:center;gap:13px;padding-bottom:13px;border-bottom:1px solid #403a2f;min-width:0}
.grind-biome-dialog-header>img,.grind-biome-dialog-header>.grind-icon-fallback{width:50px;height:50px;object-fit:contain;flex:0 0 50px}
.grind-biome-dialog-header>div{min-width:0;display:grid;gap:3px;flex:1}
.grind-biome-dialog-header small{font-size:10px;color:#c5ab73;font-weight:650;letter-spacing:.09em}
.grind-biome-dialog-header h3{font-size:19px;line-height:1.2;color:#efe5d3;margin:0;overflow-wrap:anywhere}
.grind-biome-dialog-header span{font-size:11px;color:#a59d8e}
.grind-biome-dialog-close{align-self:flex-start;display:grid;place-items:center;width:35px;height:35px;background:#2a2b25;color:#dfd0b5;border:1px solid #4b453b;border-radius:8px;cursor:pointer;font-size:23px}
.grind-biome-dialog-close:hover{background:#3c3a2f}
.grind-biome-dialog-close:focus-visible{outline:2px solid #d3ba86;outline-offset:2px}
.grind-biome-source{display:grid;gap:7px;padding:13px;border:1px solid #403c30;border-radius:10px;background:#20221b;min-width:0}
.grind-biome-source.is-recommended{border-color:#767149;background:#24261d}
.grind-biome-source-lead{display:flex;justify-content:space-between;gap:9px;align-items:center;flex-wrap:wrap}
.grind-biome-source-lead>strong{font-size:13px;color:#e6dfd1;overflow-wrap:anywhere}
.grind-biome-source-type{font-size:9px;color:#ceb784;background:#373126;border:1px solid #655538;border-radius:5px;padding:4px 6px;font-weight:650;letter-spacing:.04em}
.grind-biome-source-chance{margin:0;color:#d5c18f;font-size:12px;font-weight:650}
.grind-biome-locations-heading{color:#aba99c;font-size:11px}
.grind-biome-chip-list{display:flex;gap:6px;flex-wrap:wrap}
.grind-biome-chip{padding:6px 9px;border:1px solid #415141;border-radius:6px;background:#29342a;color:#d1dfd0;font-size:11px}
.grind-biome-muted{margin:0;color:#aaa99e;font-size:12px;line-height:1.55}
.grind-biome-source-tip,.grind-biome-processing{margin:0;padding:12px;border:1px solid #514c3e;border-radius:9px;background:#23231d;color:#cec3af;font-size:12px;line-height:1.6}
.grind-biome-processing{display:grid;gap:6px}
.grind-biome-processing>p{margin:0}
.grind-biome-dialog-footer{padding-top:11px;border-top:1px solid #403a2f;display:grid;gap:9px}
.grind-biome-dialog-footer>p{font-size:11px;line-height:1.55;color:#a7a196;margin:0}
.grind-biome-dialog-footer>a{color:#d8bc86;font-size:12px;font-weight:650;text-decoration:none}
.grind-biome-dialog-footer>a:hover{text-decoration:underline}
@media(max-width:560px){
 .grind-biome-dialog{width:96vw;max-width:96vw;max-height:92dvh;border-radius:13px}
 .grind-biome-dialog-inner{padding:13px;gap:11px}
 .grind-dependency-node-head>.grind-gatherable-icon-btn{width:30px;height:30px;flex-basis:30px}
 .grind-dependency-node-head>.grind-gatherable-icon-btn img{width:26px;height:26px}
}

/* Gatherable tier accents match the Holmgard tier palette (T1–T10). */
.grind-dependency-source-card{
  border-left:3px solid var(--grind-item-tier,#40382c);
  background:linear-gradient(125deg,color-mix(in srgb,var(--grind-item-tier,#777) 8%,#1a1b16),#1a1b16 65%);
}
.grind-dependency-tier-badge{
  display:inline-flex;align-items:center;width:max-content;max-width:100%;
  border:1px solid var(--grind-item-tier,#7d725b);border-radius:5px;
  background:color-mix(in srgb,var(--grind-item-tier,#777) 17%,#151611);
  color:color-mix(in srgb,var(--grind-item-tier,#ccc) 58%,#f7f2e8);
  padding:3px 7px;font-size:10px;font-weight:650;letter-spacing:.02em;line-height:1.35;
}
.grind-dependency-source-card .grind-output .grind-dependency-tier-badge{
  white-space:nowrap;overflow:visible;
}
.grind-dependency-node.is-raw{border-left:3px solid var(--grind-item-tier,#384039)}
.grind-dependency-node.is-raw .grind-dependency-type{
  color:color-mix(in srgb,var(--grind-item-tier,#a4c5ab) 62%,#f4eee0);
  background:color-mix(in srgb,var(--grind-item-tier,#28362a) 20%,#242720);
}
.grind-biome-dialog{
  border-top:3px solid var(--grind-item-tier,#66563a);
}
.grind-biome-dialog-header .grind-dependency-tier-badge{margin-top:3px}
.grind-biome-source.is-fish{
  border-color:#4b635c;background:#1d2926;
}
.grind-biome-source.is-fish>strong{font-size:13px;color:#e8dfd0}
.grind-dependency-step-fish-biomes{
  display:block;border-left:2px solid #739d94;background:#202923;
  border-radius:0 5px 5px 0;color:#b6d1c8!important;
  padding:6px 8px;margin-top:4px;font-size:11px;line-height:1.6;
}

/* Tier badge colors override generic gold output-label styles. */
.grind-dependency-source-card .grind-output .grind-dependency-tier-badge,
.grind-biome-dialog-header .grind-dependency-tier-badge{
  color:color-mix(in srgb,var(--grind-item-tier,#ccc) 58%,#f7f2e8);
  background:color-mix(in srgb,var(--grind-item-tier,#777) 17%,#151611);
  font-size:10px;
}

/*
 * Crafting Calculator typography harmonization
 * ---------------------------------------------
 * Follow the site's primary Inter UI family; never introduce a separate
 * Georgia or browser-default font inside the help overlay. Use the same
 * practical reading scale as Holmgard's other tools: 13px supporting text,
 * 14px ingredient labels and 11–12px metadata, including on mobile.
 */
.grind-calculator-panel,
.grind-biome-dialog{
  font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  font-size:13px;
  line-height:1.5;
  font-weight:400;
}
.grind-calculator-panel button,
.grind-calculator-panel input,
.grind-calculator-panel select,
.grind-biome-dialog button{
  font-family:inherit;
}
.grind-calculator-panel .grind-info{
  font-family:inherit;
  font-size:11px;
  font-weight:650;
}
.grind-info-tooltip{
  font:400 13px/1.55 Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif!important;
}
.grind-heading .muted,
.grind-step-head small,
.grind-empty p,
.grind-dependency-heading>p,
.grind-dependency-section-head small,
.grind-target-hint,
.grind-yield-note,
.grind-message{
  font-size:13px;
  line-height:1.55;
}
.grind-step-head strong,
.grind-dependency-section-head strong{
  font-size:15px;
  line-height:1.35;
}
.grind-mode-button,
.grind-target-type-button,
.grind-player-chip,
.grind-suggestion,
.grind-search-wrap input,
.grind-quantity-field input,
.grind-quantity-field select,
.grind-output strong{
  font-family:inherit;
  font-size:13px;
}
.grind-quantity-field input[type="number"]{
  font-size:16px;
}
.grind-dependency-section .grind-output strong,
.grind-dependency-source-card .grind-output strong{
  font-size:14px;
  line-height:1.35;
  white-space:normal;
  overflow-wrap:anywhere;
  text-overflow:clip;
}
.grind-dependency-source-card .grind-output span:not(.grind-dependency-tier-badge){
  font-size:13px;
}
.grind-dependency-source-heading,
.grind-dependency-quick-biomes,
.grind-dependency-event-note,
.grind-dependency-source-line,
.grind-dependency-step-copy span,
.grind-dependency-step-copy .grind-dependency-step-ingredient>span,
.grind-dependency-node-copy small,
.grind-dependency-node-copy strong{
  font-size:12px;
  line-height:1.5;
}
.grind-dependency-step-copy strong,
.grind-dependency-node-copy strong{
  font-size:14px;
  line-height:1.4;
}
.grind-dependency-source-line>strong{
  font-size:12px;
  line-height:1.35;
}
.grind-dependency-step-ingredients>span:first-child{
  font-size:12px;
}
.grind-dependency-type,
.grind-dependency-tier-badge,
.grind-dependency-source-card .grind-output .grind-dependency-tier-badge,
.grind-biome-dialog-header .grind-dependency-tier-badge{
  font-size:11px;
  line-height:1.3;
  letter-spacing:.02em;
}
.grind-dependency-warning{
  font-size:13px;
  line-height:1.6;
}
.grind-dependency-node.is-unavailable{
  border-color:#846149;
  background:#271f1a;
}
.grind-dependency-node.is-unavailable .grind-dependency-type{
  background:#553322;
  color:#efd0b7;
}
.grind-biome-dialog-header small,
.grind-biome-locations-heading,
.grind-biome-source-type,
.grind-biome-dialog-footer>p{
  font-size:11px;
  line-height:1.45;
}
.grind-biome-dialog-header span,
.grind-biome-source-chance,
.grind-biome-chip,
.grind-biome-muted,
.grind-biome-source-tip,
.grind-biome-processing,
.grind-biome-dialog-footer>a,
.grind-dependency-step-fish-biomes{
  font-size:12px;
  line-height:1.6;
}
.grind-biome-source-lead>strong{
  font-size:14px;
}
.grind-biome-dialog-header h3{
  font-size:21px;
  line-height:1.25;
}
@media(max-width:560px){
  .grind-dependency-type{font-size:11px}
  .grind-dependency-source-line{flex-wrap:wrap}
  .grind-dependency-source-line>strong{flex-basis:auto;text-align:left}
  .grind-biome-dialog-header h3{font-size:19px}
}

/* Compact, native accordions for the three crafting-plan chapters. */
details.grind-dependency-section{display:block;padding:0;gap:0}
summary.grind-dependency-section-head{
  list-style:none;cursor:pointer;align-items:center;padding:15px 18px;
  transition:background .14s ease;color:inherit;
}
summary.grind-dependency-section-head::-webkit-details-marker{display:none}
summary.grind-dependency-section-head:hover{background:#25241e}
summary.grind-dependency-section-head:focus-visible{outline:2px solid #ccb17a;outline-offset:-3px}
summary.grind-dependency-section-head:after{
  /* A centered SVG chevron avoids the font glyph's uneven baseline. */
  content:'';display:block;box-sizing:border-box;
  flex:0 0 28px;width:28px;height:28px;
  border:1px solid #59513f;border-radius:7px;
  background:#2b2923 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23d7bc85' stroke-width='2.3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") center / 15px 15px no-repeat;
  transition:transform .16s ease,background-color .16s ease;
}
details.grind-dependency-section[open]>summary.grind-dependency-section-head:after{transform:rotate(180deg)}
details.grind-dependency-section[open]>summary.grind-dependency-section-head{background:#211f1a}
.grind-dependency-section-head>div{flex:1}
.grind-dependency-section-count{
  flex:0 0 auto;color:#beb4a0;font-size:11px;line-height:1.4;
  border:1px solid #50483a;border-radius:6px;background:#27251f;padding:4px 8px;
}
.grind-dependency-section-body{display:grid;gap:12px;padding:0 18px 18px}
.grind-dependency-section-body>.grind-yield-note{margin:0;color:#a39a89;font-size:12px;line-height:1.6}
.grind-biome-source.is-animal{border-color:#776349;background:#26231d}
.grind-biome-source.is-animal>strong{font-size:14px;color:#e8dfd0}
@media(max-width:560px){
  details.grind-dependency-section{padding:0}
  summary.grind-dependency-section-head{padding:13px 12px;gap:8px;flex-wrap:wrap}
  .grind-dependency-section-head>div{flex:1 1 calc(100% - 79px)}
  .grind-dependency-section-count{margin-left:36px}
  .grind-dependency-section-body{padding:0 12px 13px}
}

/* Craft-in-order: match the existing gathering tier badges for outputs and inputs. */
.grind-dependency-step-heading{display:flex;align-items:center;flex-wrap:wrap;gap:6px 9px;min-width:0}
.grind-dependency-step-heading>strong{min-width:0}
.grind-dependency-step-ingredient{flex-wrap:wrap}
.grind-dependency-step-copy .grind-dependency-tier-badge,
.grind-dependency-step-copy .grind-dependency-step-ingredient>.grind-dependency-tier-badge{
  flex:0 0 auto;
  color:color-mix(in srgb,var(--grind-item-tier,#ccc) 58%,#f7f2e8);
  background:color-mix(in srgb,var(--grind-item-tier,#777) 17%,#151611);
  border-color:var(--grind-item-tier,#7d725b);
  font-size:11px;line-height:1.3;
  padding:3px 7px;white-space:nowrap;
}
@media(max-width:560px){
  .grind-dependency-step-heading{gap:5px 7px}
  .grind-dependency-step-copy .grind-dependency-step-ingredient>.grind-dependency-tier-badge{
    padding:2px 6px;
  }
}

/* One recommended gathering method on the card; open the dialog for alternatives. */
.grind-dependency-recommended-source{
  display:grid;gap:5px;width:100%;min-width:0;
  padding:11px 12px;border:1px solid #56513d;border-radius:9px;
  background:linear-gradient(125deg,color-mix(in srgb,var(--grind-item-tier,#9b8b69) 10%,#20221b),#20221b 72%);
  color:#ddd6c7;font-family:inherit;text-align:left;cursor:pointer;
  transition:border-color .15s ease,background-color .15s ease,transform .15s ease;
}
.grind-dependency-recommended-source:hover{
  border-color:#b9a478;background:#2a2b23;transform:translateY(-1px);
}
.grind-dependency-recommended-source:focus-visible{outline:2px solid #d8bc85;outline-offset:3px}
.grind-dependency-recommended-kicker{
  font-size:10px;font-weight:650;letter-spacing:.07em;line-height:1.4;color:#d1b883;
}
.grind-dependency-recommended-lead{
  display:flex;flex-wrap:wrap;align-items:baseline;justify-content:space-between;
  gap:4px 10px;min-width:0;font-size:13px;line-height:1.4;
}
.grind-dependency-recommended-lead>strong{
  flex:1 1 140px;min-width:0;overflow-wrap:anywhere;color:#e9dfcb;font-size:13px;font-weight:650;
}
.grind-dependency-recommended-rate{
  flex:0 0 auto;color:#d8dcbf;font-size:12px;font-weight:650;
}
.grind-dependency-recommended-disclosure{
  color:#b4ab95;font-size:11px;line-height:1.5;text-decoration:underline;text-underline-offset:2px;
}
@media(max-width:560px){
 .grind-dependency-recommended-source{padding:10px}
 .grind-dependency-recommended-lead>strong{flex-basis:120px}
}

/* Gatherable header: compact T# pill sits at top-right, aligned with item name. */
.grind-dependency-material-header{
  display:flex;align-items:flex-start;gap:9px;min-width:0;width:100%;
}
.grind-dependency-material-header>.grind-dependency-tier-badge{
  flex:0 0 auto;align-self:flex-start;margin-top:5px;
  white-space:nowrap;
  font-size:11px;line-height:1.3;
  color:color-mix(in srgb,var(--grind-item-tier,#ccc) 58%,#f7f2e8);
  background:color-mix(in srgb,var(--grind-item-tier,#777) 17%,#151611);
  border-color:var(--grind-item-tier,#7d725b);
}

/* Explicit sourcing availability for retired and uncertain materials. */
.grind-dependency-availability{
  display:inline-flex;width:fit-content;max-width:100%;
  color:#d3bd91;border:1px solid #786141;border-radius:6px;
  background:#31291d;padding:4px 7px;font-size:11px;line-height:1.4;font-weight:700;
}


/* A contextual jump from the Gear Upgrade Cart, without crowding the calculator. */
.grind-smart-link-note{display:flex;align-items:center;flex-wrap:wrap;gap:11px;margin:12px 0 17px;padding:12px 14px;border:1px solid color-mix(in srgb,currentColor 17%,transparent);border-radius:13px;background:color-mix(in srgb,currentColor 4%,transparent);font-family:var(--font-ui,"Quicksand",sans-serif);color:inherit}
.grind-smart-link-icon{display:grid;place-items:center;width:35px;height:35px;flex:none;border-radius:9px;background:color-mix(in srgb,currentColor 7%,transparent);font-size:19px}
.grind-smart-link-copy{display:grid;gap:3px;flex:1;min-width:0;overflow-wrap:anywhere}
.grind-smart-link-copy strong{font-size:13px;font-weight:700;line-height:1.35}
.grind-smart-link-copy small{font-size:12px;font-weight:600;opacity:.76;line-height:1.4}
.grind-smart-link-note>a{font-size:12px;font-weight:650;color:inherit;text-decoration:underline;text-underline-offset:3px;white-space:nowrap}
@media(max-width:520px){.grind-smart-link-note>a{margin-left:46px}}

/* Keep target choices and their help icons on a single line. */
.grind-calculator-panel .grind-target-type{
  grid-template-columns:minmax(0,1.15fr) minmax(0,.58fr) minmax(0,1.38fr);
  gap:3px;
}
.grind-calculator-panel .grind-target-option{
  min-width:0;
  gap:2px;
}
.grind-calculator-panel .grind-target-option>.grind-target-type-button{
  white-space:nowrap;
  padding-inline:2px;
  line-height:1.3;
}
.grind-calculator-panel .grind-target-option>.grind-info{
  width:16px;
  height:16px;
  flex:0 0 16px;
  margin-left:0;
}
@media(max-width:600px){
  .grind-calculator-panel .grind-target-type{gap:2px}
  .grind-calculator-panel .grind-target-option>.grind-target-type-button{
    font-size:clamp(10px,2.8vw,12px);
    padding-inline:0;
  }
  .grind-calculator-panel .grind-target-option>.grind-info{
    width:14px;height:14px;flex-basis:14px;
  }
}
