/* CashControl purchase planner — supports standard light/dark themes */
.pp-module{display:grid;gap:16px;max-width:1100px;margin:0 auto;padding-bottom:34px;color:var(--text-primary,var(--text,#e5ecf9))}
.pp-module h1,.pp-module h2,.pp-module h3,.pp-module p{margin:0}
.pp-header{padding:22px 0 8px;display:flex;align-items:center;justify-content:space-between;gap:16px}
.pp-header h1{font-size:clamp(24px,4vw,32px);letter-spacing:-.03em}
.pp-header p{opacity:.72;margin-top:5px;font-size:13px}
.pp-eyebrow{font-size:11px;letter-spacing:.12em;font-weight:800;color:#47b99c;margin-bottom:5px}
.pp-readonly{font-size:11px;border:1px solid #47b99c77;color:#47b99c;padding:7px 10px;border-radius:20px;white-space:nowrap}
.pp-card,.pp-output{background:var(--card-bg,var(--surface,rgba(255,255,255,.055)));border:1px solid var(--border,rgba(127,150,179,.2));border-radius:20px;padding:20px;box-shadow:0 8px 24px rgba(0,0,0,.04)}
.pp-section-title{display:flex;justify-content:space-between;align-items:center;margin-bottom:14px}
.pp-section-title h2{font-size:18px}.pp-section-title small{opacity:.7}
.pp-module input,.pp-module select{width:100%;min-width:0;border-radius:11px;padding:12px;border:1px solid var(--border,rgba(145,163,184,.35));background:var(--input-bg,rgba(120,150,190,.08));color:inherit;font-size:14px;box-sizing:border-box}
.pp-module label{font-size:12px;font-weight:600;opacity:.95;display:flex;flex-direction:column;gap:6px}
.pp-module input:focus,.pp-module select:focus{outline:2px solid #47b99c80;outline-offset:1px}
.pp-search-results{display:grid;max-height:220px;overflow-y:auto;gap:4px;margin:8px 0}
.pp-search-results button{background:transparent;color:inherit;border:1px solid transparent;text-align:left;padding:10px 12px;border-radius:10px;display:flex;align-items:center;gap:10px}
.pp-search-results button b{font-weight:600;flex:1}.pp-search-results button small{opacity:.65}.pp-search-results button span{font-weight:800;color:#47b99c}
.pp-search-results button:hover:not(:disabled){border-color:#47b99c66;background:rgba(47,173,138,.07)}.pp-search-results button:disabled{opacity:.52}
.pp-hint,.pp-empty{padding:10px;font-size:12px;opacity:.6}
.pp-items{display:grid;gap:8px;margin-top:10px}
.pp-selected-item{display:grid;grid-template-columns:minmax(110px,2fr) minmax(88px,.6fr) minmax(110px,.8fr) 32px;align-items:center;gap:10px;border:1px solid var(--border,rgba(127,150,179,.25));background:rgba(127,150,179,.06);padding:10px;border-radius:12px}
.pp-selected-item strong{font-size:13px;display:block}.pp-selected-item small{display:block;opacity:.68;font-size:11px;margin-top:3px}.pp-selected-item label{font-size:10px}.pp-selected-item .pp-small{padding:8px;font-size:13px}
.pp-remove{border:0;border-radius:8px;background:rgba(239,115,115,.1);color:#ea7777;font-size:22px;height:32px;cursor:pointer}
.pp-filters{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px 22px}
.pp-field{min-width:0}.pp-label{font-size:13px;font-weight:750;margin-bottom:11px}.pp-presets{display:flex;flex-wrap:wrap;gap:6px;margin-bottom:12px}
.pp-pill{border:1px solid var(--border,rgba(130,154,180,.34));border-radius:40px;background:transparent;color:inherit;padding:7px 10px;font-size:11px;cursor:pointer}
.pp-pill.selected,.pp-pill:hover{background:#2ca68422;border-color:#2ca684;color:#44bb99}
.pp-two{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;align-items:end}.pp-last{align-self:end}
.pp-help{font-size:11px;opacity:.65;line-height:1.5;margin-top:7px!important}
.pp-action-card{display:grid;gap:12px}.pp-primary{width:100%;padding:14px;font-weight:750}.pp-notice{border-radius:10px;background:rgba(77,157,230,.08);padding:12px;font-size:12px}.pp-error{color:#ee7373;background:rgba(239,115,115,.08)}
.pp-output{display:grid;gap:20px}.pp-results-head{display:flex;justify-content:space-between;align-items:center;gap:15px}.pp-results-head h2{font-size:22px}.pp-results-head h3{font-size:18px}.pp-results-head p{font-size:12px;opacity:.65;margin-top:5px}
.pp-head-stat{display:flex;flex-direction:column;align-items:center;border-radius:14px;padding:12px 18px;background:rgba(47,172,132,.12);white-space:nowrap}.pp-head-stat strong{color:#43b995;font-size:25px}.pp-head-stat span{font-size:10px;opacity:.75}
.pp-alert{border-radius:12px;background:rgba(239,179,58,.09);border:1px solid rgba(239,179,58,.24);padding:12px;font-size:12px;line-height:1.55}
.pp-comparison,.pp-product-graph{border:1px solid var(--border,rgba(127,150,179,.24));border-radius:14px;padding:15px;min-width:0}.pp-comparison h3{margin-bottom:15px}
.pp-bar-row{width:100%;display:grid;grid-template-columns:minmax(110px,1.2fr) minmax(120px,2fr) minmax(80px,.6fr);gap:12px;align-items:center;text-align:left;border:0;background:none;color:inherit;border-radius:8px;padding:9px 5px;cursor:pointer}
.pp-bar-row.pp-bar-selected,.pp-bar-row:hover{background:rgba(63,170,140,.08)}.pp-bar-name{font-size:12px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.pp-bar-row strong{text-align:right;font-size:12px;color:#43b995}
.pp-bar-track{height:17px;border-radius:5px;display:block;background:rgba(127,150,179,.09);position:relative;overflow:hidden}.pp-bar-demand,.pp-bar-stock{position:absolute;height:7px;left:0;border-radius:4px;top:1px;background:#5f92e8}.pp-bar-stock{background:#43b995;top:9px}
.pp-legend{display:flex;gap:15px;flex-wrap:wrap;font-size:11px;opacity:.75;margin-top:10px}.pp-legend span{display:flex;align-items:center;gap:6px}.pp-legend i{width:14px;height:5px;border-radius:3px;background:#5f92e8;display:inline-block}.pp-legend i.pp-lg-stock,.pp-legend i.pp-lg-line-green{background:#43b995}.pp-legend i.pp-lg-line-red{background:#ef7373}
.pp-product-graph .pp-results-head strong{font-size:14px;color:#43b995}.pp-forecast-svg{display:block;width:100%;height:auto;max-height:290px;margin:10px 0}
.pp-table-scroll{overflow-x:auto}.pp-table{width:100%;border-collapse:collapse;min-width:610px}.pp-table th,.pp-table td{padding:12px 9px;border-bottom:1px solid var(--border,rgba(127,150,179,.19));font-size:12px;text-align:left;white-space:nowrap}.pp-table th{font-size:11px;opacity:.62}.pp-table td:first-child{white-space:normal;min-width:150px}.pp-table td small{display:block;font-size:10px;opacity:.7;margin-top:3px}.pp-table td small.pp-warning{color:#ed9e59;opacity:1}.pp-table-order{color:#43b995;font-weight:750}.pp-print{justify-self:start}
@media(max-width:700px){.pp-header{padding-top:8px}.pp-readonly{display:none}.pp-card,.pp-output{padding:14px;border-radius:14px}.pp-filters{grid-template-columns:1fr}.pp-selected-item{grid-template-columns:1fr 1fr 32px}.pp-selected-item>div{grid-column:1/-1}.pp-selected-item label:nth-child(3){grid-column:2}.pp-selected-item .pp-remove{grid-column:3;grid-row:2}.pp-bar-row{grid-template-columns:minmax(90px,.9fr) minmax(90px,1.6fr) minmax(65px,.6fr);gap:7px}.pp-bar-row strong{font-size:11px}}
@media print{.pp-module>.pp-card,.pp-header,.pp-print{display:none!important}.pp-output{border:none;box-shadow:none}}
/* Purchase lead-time projection: extra stock metrics, separate delivery and
   end-of-day snapshot dates; responsive and theme-compatible. */
.pp-metric-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin-top:14px}
.pp-metric-grid>div{min-width:0;padding:12px;border-radius:12px;background:rgba(106,150,180,.07);border:1px solid var(--border,rgba(130,154,180,.2));display:flex;flex-direction:column;gap:7px}
.pp-metric-grid small{font-size:11px;line-height:1.45;opacity:.72}
.pp-metric-grid strong{font-size:clamp(14px,1.7vw,19px);overflow-wrap:anywhere}
.pp-metric-grid .pp-metric-main{background:rgba(47,172,132,.13);border-color:rgba(47,172,132,.28)}
.pp-metric-main strong,.pp-recommendation{color:#43b995!important}
.pp-product-detail{border:1px solid var(--border,rgba(127,150,179,.25));padding:15px;border-radius:14px}
.pp-product-detail .pp-results-head{align-items:start}
.pp-product-detail .pp-results-head h3{font-size:17px}
.pp-recommendation{font-size:16px;text-align:right}
.pp-formula{font-size:12px;opacity:.8;line-height:1.6;margin-top:12px!important}
.pp-warning{font-size:12px;color:#eeac65;line-height:1.45;margin-top:10px!important}
.pp-shortage-notice{padding:12px;border:1px solid rgba(232,128,86,.4);border-radius:11px;background:rgba(232,128,86,.11);color:inherit;font-size:12px;line-height:1.55}
.pp-safety-presets{margin-top:10px}
.pp-product-graph{overflow:hidden}
@media(max-width:750px){.pp-metric-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.pp-recommendation{font-size:13px}}
@media(max-width:420px){.pp-product-detail .pp-results-head{flex-direction:column;align-items:start}.pp-metric-grid{gap:7px}.pp-metric-grid>div{padding:9px}.pp-metric-grid strong{font-size:14px}}

.pp-export-tools{display:flex;align-items:center;gap:12px;flex-wrap:wrap}
.pp-export-tools .pp-help{max-width:600px;margin:0!important}
.pp-export-tools .pp-print{white-space:nowrap}

/* Primary ready-to-share PDF; Excel remains an optional numerical export. */
.pp-export-tools .pp-pdf{background:linear-gradient(135deg,#155781,#128F93);color:#fff;border-color:transparent;font-weight:700}

/* Mobile Safari/Telegram: date inputs must never share an undersized column.
   Native iOS dates are not compressible to half a 360px screen. */
.pp-search-meta{font-size:11px;opacity:.72;line-height:1.5;margin-top:8px!important}
.pp-telegram-send{border:1px solid rgba(47,172,132,.65)!important;color:#43b995!important;font-weight:700}
.pp-two>label,.pp-filters .pp-field,.pp-filters label{min-width:0;max-width:100%}
.pp-module input[type="date"]{min-width:0;max-width:100%;width:100%;display:block;box-sizing:border-box}
@media(max-width:700px){
  .pp-filters{grid-template-columns:minmax(0,1fr);gap:20px}
  .pp-two{grid-template-columns:minmax(0,1fr);gap:12px}
  .pp-module input[type="date"]{font-size:16px;line-height:1.4;min-height:48px;padding:10px 12px}
  .pp-module{padding-bottom:calc(116px + env(safe-area-inset-bottom,0px))}
}
