/* ==========================================================
   pandabu V2.0.4 RC16.280c
   Notvorrat ↔ Vorrat active bridge + responsive polish
   Scoped to Vorsorge & Notfall only.
   ========================================================== */

/* ---------- Overview / "Dein Vorsorgeplan" ---------- */
html:not([data-theme="dark"]) .rc262-overview{
  --rc262-card:#ffffff;
  --rc262-soft:#f2f6f7;
  --rc262-line:#d8e3e6;
}
html:not([data-theme="dark"]) .rc262-overview-dashboard{
  background:linear-gradient(180deg,#ffffff 0%,#f8fbfb 100%)!important;
  border-color:#d4e2e4!important;
  box-shadow:0 10px 30px rgba(35,62,72,.07)!important;
  color:#172127!important;
}
html:not([data-theme="dark"]) .rc262-overview-dashboard .rc263-plan-copy>span,
html:not([data-theme="dark"]) .rc262-overview-dashboard .rc263-plan-copy>small,
html:not([data-theme="dark"]) .rc262-overview-dashboard .rc262-status-summary span{
  color:#64737b!important;
}
html:not([data-theme="dark"]) .rc267-progress-ring::before{background:#fff!important}
html:not([data-theme="dark"]) .rc262-overview-category{background:#f7fafb!important}
html:not([data-theme="dark"]) .rc262-overview-category.open{background:#fffaf1!important}
html:not([data-theme="dark"]) .rc262-overview-category.done{background:#f1fbf8!important}

html[data-theme="dark"] .rc262-overview{
  --rc262-card:#20272e;
  --rc262-soft:#29323a;
  --rc262-line:#394550;
}
html[data-theme="dark"] .rc262-overview-dashboard{
  background:linear-gradient(180deg,#222a32 0%,#1e252c 100%)!important;
  border-color:#38444e!important;
}

/* RC264 was squeezed by the global .secondary width rule on desktop. */
.rc262-overview-dashboard .rc264-reset-row{
  display:grid!important;
  grid-template-columns:minmax(0,1fr) auto!important;
  align-items:center!important;
  gap:16px!important;
  padding-top:13px!important;
}
.rc262-overview-dashboard .rc264-reset-row>div{min-width:0!important}
.rc262-overview-dashboard .rc264-reset-button{
  width:auto!important;
  max-width:max-content!important;
  justify-self:end!important;
  padding:.62rem .9rem!important;
}

/* Einkaufsplanung: both choices must read as intentional primary options. */
.rc266-shopping-actions{gap:12px!important}
.rc266-shopping-option .rc266-method-main{
  min-height:56px!important;
  border:1px solid transparent!important;
  box-shadow:0 6px 16px rgba(26,49,57,.08)!important;
}
.rc266-shopping-option:first-child .rc266-method-main{
  background:var(--accent,#13b8aa)!important;
  color:#fff!important;
  border-color:color-mix(in srgb,var(--accent,#13b8aa) 78%,#0b756e)!important;
}
.rc266-shopping-option:nth-child(2) .rc266-method-main{
  background:#d9902d!important;
  color:#fff!important;
  border-color:#bd771b!important;
}
.rc266-shopping-option:first-child .rc266-method-info{background:rgba(5,94,88,.48)!important;color:#fff!important}
.rc266-shopping-option:nth-child(2) .rc266-method-info{background:rgba(112,64,7,.42)!important;color:#fff!important}
html[data-theme="dark"] .rc266-shopping-option:nth-child(2) .rc266-method-main{
  background:#c98228!important;
  border-color:#e3a54e!important;
}

/* ---------- Guided desktop view ----------
   Do not vertically centre the current position; it must start immediately
   below the fixed header/categories instead of appearing near the bottom. */
@media(min-width:900px){
  .rc251-form-stage{
    align-items:start!important;
    align-content:start!important;
    padding-top:28px!important;
    padding-bottom:36px!important;
    scroll-padding-top:28px!important;
  }
  .rc251-form-stage>.emergency-smart-group,
  .rc251-form-stage>.emergency-wizard-complete{
    margin-top:0!important;
    margin-bottom:0!important;
  }
  .rc251-form-shell .emergency-requirement{
    max-width:820px!important;
  }
}

/* Similar products always form real rows; controls line up vertically. */
@media(min-width:721px){
  .emergency-product-plan-list{display:grid!important;gap:9px!important}
  .emergency-product-plan-row{
    grid-template-columns:minmax(0,1fr) minmax(290px,auto)!important;
    grid-template-rows:auto auto!important;
    column-gap:16px!important;
    row-gap:5px!important;
    align-items:center!important;
    min-height:72px!important;
  }
  .emergency-product-plan-select{grid-column:1!important;grid-row:1!important;min-width:0!important}
  .emergency-product-plan-status{grid-column:1!important;grid-row:2!important;justify-self:start!important}
  .emergency-product-controls{
    grid-column:2!important;
    grid-row:1 / span 2!important;
    justify-self:end!important;
    align-self:center!important;
    min-width:290px!important;
  }
  .emergency-product-controls .emergency-product-qty{min-width:150px!important}
}

/* ---------- Active inventory bridge ---------- */
.emergency-inventory-bridge{
  display:grid;
  gap:9px;
  padding:11px;
  border:1px solid color-mix(in srgb,var(--accent,#13b8aa) 32%,var(--line,#dbe2e6));
  border-radius:15px;
  background:color-mix(in srgb,var(--accent-soft,rgba(19,184,170,.08)) 48%,var(--surface,#fff));
}
.emergency-inventory-bridge-head{display:grid;gap:3px}
.emergency-inventory-bridge-head strong{font-size:.88rem}
.emergency-inventory-bridge-head small{font-size:.74rem;color:var(--muted,#68757f);line-height:1.42}
.emergency-inventory-bridge-row{
  display:grid;
  grid-template-columns:22px 42px minmax(0,1fr) auto;
  align-items:center;
  gap:9px;
  padding:9px 10px;
  border:1px solid var(--line,#dbe2e6);
  border-radius:12px;
  background:var(--surface,#fff);
  cursor:pointer;
}
.emergency-inventory-bridge-row.linked{
  border-color:color-mix(in srgb,var(--accent,#13b8aa) 52%,var(--line,#dbe2e6));
  background:color-mix(in srgb,var(--accent-soft,rgba(19,184,170,.08)) 62%,var(--surface,#fff));
}
.emergency-inventory-bridge-row.blocked{opacity:.58;cursor:not-allowed}
.emergency-inventory-bridge-row>input{width:18px;height:18px;accent-color:var(--accent,#13b8aa)}
.emergency-inventory-bridge-icon{width:42px;height:42px;display:grid;place-items:center}
.emergency-inventory-bridge-icon .content-icon{width:42px!important;height:42px!important;min-width:42px!important}
.emergency-inventory-bridge-copy{display:grid;gap:1px;min-width:0}
.emergency-inventory-bridge-copy strong{font-size:.84rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.emergency-inventory-bridge-copy small{font-size:.72rem;color:var(--muted,#68757f);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.emergency-inventory-bridge-copy em{font-size:.69rem;font-style:normal;color:var(--muted,#68757f)}
.emergency-bridge-equivalent{font-size:.75rem;font-weight:850;color:var(--accent,#13b8aa);white-space:nowrap}
.emergency-bridge-conversion{display:grid;gap:3px;justify-items:end}
.emergency-bridge-conversion>span:first-child{font-size:.66rem;color:var(--muted,#68757f);font-weight:800}
.emergency-bridge-conversion-field{display:grid;grid-template-columns:74px auto;align-items:center;overflow:hidden;border:1px solid var(--line,#dbe2e6);border-radius:10px;background:var(--surface,#fff)}
.emergency-bridge-conversion-field input{width:74px;height:36px;border:0;background:transparent;color:inherit;text-align:right;padding:0 8px;font:inherit;font-weight:850;outline:0}
.emergency-bridge-conversion-field b{padding:0 8px;font-size:.72rem;white-space:nowrap}
.emergency-bridge-save{width:100%!important;min-height:42px!important;margin-top:2px}
.emergency-inventory-bridge-empty{padding:12px;border:1px dashed var(--line,#dbe2e6);border-radius:11px;color:var(--muted,#68757f);font-size:.76rem;text-align:center}
.emergency-existing-stock-manual{margin-top:10px;border-top:1px solid var(--line,#dbe2e6);padding-top:9px}
.emergency-existing-stock-manual>summary{cursor:pointer;font-size:.76rem;font-weight:850;color:var(--muted,#68757f)}
.emergency-existing-stock-manual-body{padding-top:8px}

html[data-theme="dark"] .emergency-inventory-bridge{
  background:rgba(18,184,171,.055);
  border-color:rgba(18,184,171,.28);
}
html[data-theme="dark"] .emergency-inventory-bridge-row,
html[data-theme="dark"] .emergency-bridge-conversion-field{background:#20282f}
html[data-theme="dark"] .emergency-inventory-bridge-row.linked{background:rgba(18,184,171,.09)}

@media(max-width:720px){
  .rc262-overview-dashboard .rc264-reset-row{
    grid-template-columns:1fr!important;
    align-items:stretch!important;
  }
  .rc262-overview-dashboard .rc264-reset-button{width:100%!important;max-width:none!important;justify-self:stretch!important}
  .rc266-shopping-actions{gap:8px!important}
  .rc266-shopping-option .rc266-method-main{min-height:52px!important;font-size:.88rem!important}
  .emergency-inventory-bridge-row{
    grid-template-columns:22px 40px minmax(0,1fr)!important;
    gap:8px!important;
  }
  .emergency-bridge-equivalent,
  .emergency-bridge-conversion{grid-column:2 / -1;justify-self:stretch!important}
  .emergency-bridge-conversion{justify-items:stretch!important}
  .emergency-bridge-conversion-field{grid-template-columns:minmax(0,1fr) auto!important}
  .emergency-bridge-conversion-field input{width:100%!important;text-align:left!important}
  .emergency-inventory-bridge-copy strong{white-space:normal}
}
