/* Product styles for the compact phone screen; existing PC/phone 1 editors stay intact. */
.s2-mail { max-width: 500px; margin: 0 auto 16px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: white; }
.s2-mail > summary { min-height: 44px; padding: 10px 0; cursor: pointer; font-weight: 700; color: var(--green); }
.sales-mail-panel { min-width: 0; overflow-wrap: anywhere; }
.sales-mail-panel * { box-sizing: border-box; }
.sales-mail-panel [hidden] { display: none !important; }
.sales-mail-panel summary { min-height: 44px; padding: 12px 0; cursor: pointer; font-weight: 700; }
.sales-mail-panel label { display: block; margin: 8px 0; }
.sales-mail-panel input:not([type=checkbox]),.sales-mail-panel select,.sales-mail-panel textarea { display: block; width: 100%; min-width: 0; min-height: 44px; padding: 8px; font: inherit; border: 1px solid var(--line); border-radius: 8px; background: white; color: var(--navy); }
.sales-mail-panel button { min-height: 44px; white-space: normal; margin: 4px 4px 4px 0; }
.sales-mail-panel input[type=checkbox] { width: 20px; height: 20px; vertical-align: middle; }
.mail-filters { display: flex; flex-wrap: wrap; align-items: end; gap: 8px; margin: 12px 0; }
.mail-filters label { flex: 1 1 180px; }
.mail-results { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,300px),1fr)); gap: 12px; }
.mail-report { min-width: 0; border: 1px solid var(--line); border-radius: 10px; padding: 12px; background: white; }
.mail-report h3 { margin: 0; font-size: 17px; }
.mail-report-state { font-size: 14px; color: var(--muted); }
.mail-item { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 6px; padding: 10px 0; border-top: 1px solid var(--line); }
.mail-item > span:not(.mail-quantity) { grid-column: 1 / -1; font-size: 14px; }
.mail-quantity { font-weight: bold; font-size: 20px; }
.sales-mail-panel [data-mail-preview]:not(:empty) { padding: 12px; border: 2px solid var(--green); border-radius: 8px; }
.sales-mail-panel [data-stock-result] { display: block; margin-top: 10px; }
body.store-mode header { height: auto; min-height: 64px; flex-wrap: wrap; gap: 8px; padding-top: 10px; padding-bottom: 10px; }
body.store-mode .header-meta { flex-wrap: wrap; min-width: 0; }
body.store-mode .mode-switch button { min-height: 44px; padding: 6px 8px; }
body.store-mode #today,body.store-mode #connection-state { display: none; }
body.store2-mode .content { padding: 12px 10px 30px; }
body.store2-mode #page-title { font-size: 1.1rem; }
#smartphone2-root { font-size: 16px; overflow-wrap: anywhere; }
#smartphone2-root * { box-sizing: border-box; }
#smartphone2-root button { min-height: 44px; white-space: normal; }
#smartphone2-root input,#smartphone2-root select { width: 100%; min-width: 0; min-height: 44px; padding: 8px 6px; border: 1px solid var(--line); border-radius: 8px; font: inherit; background: white; color: var(--navy); }
#smartphone2-root input[data-s2-field] { font-variant-numeric: tabular-nums; text-align: center; font-size: 20px; font-weight: 700; }
#smartphone2-root input::placeholder { font-size: 14px; font-weight: 400; }
#smartphone2-root label { display: grid; gap: 5px; font-size: 14px; }
#smartphone2-root [hidden] { display: none !important; }
.s2-work { max-width: 500px; margin: auto; color: var(--navy); }
.w-steps { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:6px; margin:12px 0; }
.w-steps span { padding:12px 2px; text-align:center; border-radius:8px; background:#e4e9ec; font-size:14px; }
.w-steps button[aria-pressed=true],.w-steps .active { background:var(--green); color:white; }
.w-counts { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:6px; margin:12px 0; }
.w-counts label { text-align:center; }
.w-tier { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr) 56px; gap:6px; align-items:end; margin:12px 0; }
.w-tier button { padding:6px 2px; font-size:13px; }
.w-date { font-size:13px; color:var(--green); margin:8px 0; }
.w-label { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:center; gap:10px; padding:14px 0; border-bottom:1px solid var(--line); }
.w-label h3 { font-size:16px; }
.w-amount { text-align:right; font-weight:700; }
.w-label-section { margin-top:16px; }
.w-summary { padding:12px; border-radius:8px; background:#edf6f2; }
.w-completion { padding:18px; border:2px solid var(--green); border-radius:12px; background:#d9f2e4; line-height:1.8; }
.w-review-line { display:flex; justify-content:space-between; padding:12px 0; border-bottom:1px solid var(--line); }
body.store2-mode #organization-selector { display: none !important; }
#smartphone2.active { display: flex; flex-direction: column; max-width: 500px; margin: auto; }
#smartphone2-root, #smartphone2-root .s2-work { display: contents; }
#smartphone2-root .s2-pickers { order: -1; margin-bottom: 16px; }
#smartphone2 > .s2-mail { width: 100%; box-sizing: border-box; }
.s2-pickers { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,145px); gap: 8px; }
.s2-tabs,.s2-ages { display: grid; gap: 6px; margin: 12px 0; }
.s2-tabs { grid-template-columns: repeat(2,minmax(0,1fr)); }
.s2-ages { grid-template-columns: repeat(3,minmax(0,1fr)); }
.s2-tabs button,.s2-ages button { background: white; color: var(--navy); border: 1px solid var(--line); border-radius: 8px; }
.s2-tabs button[aria-pressed=true],.s2-ages button[aria-pressed=true] { background: var(--green); color: white; border-color: var(--green); }
.s2-ages small { display: block; margin-top: 3px; font-size: 12px; }
.s2-policy,.s2-note,.s2-code-meta { margin: 8px 0; font-size: 14px; color: var(--muted); }
.s2-heading { font-size: 17px; margin: 12px 0; }
.s2-list { padding: 0 10px; background: white; border: 1px solid var(--line); border-radius: 12px; }
.s2-row { padding: 10px 0; border-bottom: 1px solid var(--line); }
.s2-row:last-child { border-bottom: 0; }
.s2-row h3 { font-size: 16px; margin: 0 0 6px; }
.s2-row h3 small { margin-left: 6px; font-size: 14px; font-weight: 400; }
.s2-label-head,.s2-label-grid { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,110px) minmax(0,58px); align-items: center; gap: 8px; }
.s2-label-head { padding: 6px 10px; font-size: 14px; color: var(--muted); }
.s2-code { font-size: 22px; font-variant-numeric: tabular-nums; }
.s2-quantity { text-align: center; font-size: 24px; font-variant-numeric: tabular-nums; }
.s2-quantity small { display: block; font-size: 12px; font-weight: 400; }
.s2-price-save { display: block; margin: 7px 0 0 auto; font-size: 14px; }
.s2-row-title { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 8px; }
.s2-row-title span { font-size: 14px; color: var(--muted); }
.s2-count-head,.s2-count-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; text-align: center; }
.s2-count-head { margin: 10px; font-size: 14px; color: var(--muted); }
#smartphone2-root .s2-markdown,#smartphone2-root .s2-collection { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,120px); align-items: center; gap: 8px; margin-top: 8px; }
.s2-error { color: var(--danger); font-size: 14px; margin: 7px 0 0; }
.s2-all,.s2-refresh { width: 100%; margin-top: 12px; }
.s2-review { background: white; border: 1px solid var(--line); padding: 14px; border-radius: 12px; }
.s2-review pre { white-space: pre-wrap; font: inherit; line-height: 1.65; }
@media(max-width:360px) {
 .s2-pickers { grid-template-columns: minmax(0,1fr) minmax(0,138px); }
 .s2-label-head,.s2-label-grid { grid-template-columns: minmax(0,1fr) minmax(0,100px) minmax(0,48px); gap: 6px; }
 .s2-code { font-size: 20px; }
 body.store-mode .header-meta { width: 100%; justify-content: space-between; }
}

.stock-loss-panel { max-width: 1100px; margin: auto; }
.stock-loss-panel label { display: grid; gap: 5px; min-width: 0; }
.stock-loss-panel input,.stock-loss-panel select,.stock-loss-panel textarea { width: 100%; min-width: 0; box-sizing: border-box; }
.loss-fields,.loss-filters { display: grid; grid-template-columns: repeat(auto-fit,minmax(220px,1fr)); gap: 12px; }
.loss-form { gap: 12px; }
.loss-records { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,300px),1fr)); gap: 12px; margin-top: 16px; }
.stock-loss-panel pre,.loss-note { white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; }
.stock-loss-panel [hidden] { display: none !important; }
#smartphone2-loss { max-width: 500px; }
#smartphone2-loss .loss-fields,#smartphone2-loss .loss-filters { grid-template-columns: minmax(0,1fr); }

.estimated-stock-panel { max-width:1100px; margin:auto; }
.stock-filters { display:grid; grid-template-columns:repeat(auto-fit,minmax(210px,1fr)); gap:12px; }
.stock-filters label { display:grid; gap:5px; min-width:0; }
.stock-filters input,.stock-filters select { min-width:0; width:100%; box-sizing:border-box; }
.estimated-stock-results { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,340px),1fr)); gap:14px; margin-top:16px; }
.estimated-stock-card h3 { margin-top:0; }
.estimated-stock-number strong { font-size:32px; color:var(--green); }
.stock-price-list { border-top:1px solid var(--line); margin-top:12px; }
.stock-notes { padding-left:20px; font-size:14px; }
.stock-zero { display:flex; gap:8px; align-items:center; }
.stock-zero input { width:auto; }
#smartphone2-estimate { max-width:500px; }
#smartphone2-estimate .stock-filters { grid-template-columns:minmax(0,1fr); }
/* Smartphone 2: approved store tabs and compact workflow. */
#smartphone2-root .s2-pickers{display:block}
.w-work-date{display:flex!important;align-items:center;justify-content:space-between;gap:12px}
#smartphone2-root .w-work-date input{width:160px}
.w-store-tabs{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:5px}
#smartphone2-root .w-store-tabs button{padding:6px 2px;font-size:11px;line-height:1.5;min-height:70px;border-radius:8px;border:1px solid var(--line);background:white;color:var(--navy);overflow-wrap:anywhere}
.w-store-tabs small{display:block}
#smartphone2-root .w-store-tabs button[aria-pressed=true]{background:var(--green);color:white}
.w-selected-store{background:#e0f0e9;border-left:4px solid var(--green);padding:12px;font-weight:bold}
.w-quick-actions{display:flex;gap:8px}.w-quick-actions button{flex:1;min-width:0;font-size:13px}
.w-zero-done,.w-zero-feedback{background:#d9f2e4!important;color:#116549!important;border:2px solid #168767!important;padding:12px;border-radius:8px;font-weight:bold}
.w-markdown-details,.w-back-details{margin-top:14px;border-top:1px solid var(--line);padding-top:8px}
.w-markdown-details>summary,.w-back-details>summary{padding:12px 0;font-weight:bold;cursor:pointer}
.w-back-details fieldset{border:1px solid var(--line);border-radius:8px;margin:12px 0}
#smartphone2-root .w-back-details fieldset label{display:inline-flex;align-items:center;gap:6px;min-height:44px;margin-right:12px}
#smartphone2-root input[type=checkbox]{width:20px;min-height:20px}
#smartphone2-root textarea{width:100%;min-height:70px;font:inherit;border:1px solid var(--line);border-radius:8px;padding:10px}
#smartphone2-root .w-compact-label{display:grid;grid-template-columns:minmax(0,1fr) 42px 42px 40px 70px;gap:5px;font-size:13px;align-items:center}
#smartphone2-root .w-compact-label .s2-code{font-size:12px;overflow-wrap:anywhere}
.w-compact-label small{display:block;font-size:10px}
.w-price-editor{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.2fr);gap:6px}
.w-price-heading{display:flex;align-items:center;gap:5px;font-size:12px;overflow-wrap:anywhere}
.w-price-heading strong{font-size:11px}.w-price-editor>.s2-note{display:none}
.w-price-editor .w-tier{display:grid;grid-template-columns:1fr 1fr;gap:5px}.w-price-editor .w-tier button{grid-column:1/-1}.w-price-editor .w-tier label{font-size:11px}
.w-product-buttons{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.w-product-buttons button{min-height:52px;background:white;border:1px solid var(--line);border-radius:8px;padding:10px;color:var(--navy)}.w-product-buttons button[aria-pressed=true]{background:var(--green);color:white}
.w-stock-header,.w-stock-line{display:grid;grid-template-columns:minmax(0,1fr) 44px 65px 75px;gap:5px;padding:10px 0;font-size:12px;align-items:center}.w-stock-header{color:var(--muted)}.w-stock-line{border-bottom:1px solid var(--line)}.w-stock-line strong{font-size:15px}.w-stock-product details{font-size:12px;margin:8px 0}.w-stock-product>p{font-size:12px}
.w-inline-main{display:grid;grid-template-columns:minmax(0,1fr) 36px 40px 52px 68px;gap:5px;align-items:center;font-size:12px}.w-inline-main strong{font-size:11px;overflow-wrap:anywhere}.w-inline-main label{font-size:10px!important}#smartphone2-root .w-inline-main input{font-size:17px;font-weight:600;text-align:right;padding:8px 3px}.w-inline-editor>details{font-size:12px;margin-top:8px}.w-inline-editor>details>summary{min-height:44px;padding:12px 0}
/* Compact Smartphone 2 supplementary tools. */
.w-selected-store{display:flex;align-items:center;justify-content:space-between;background:#e6f4ec;padding:10px;border-radius:10px;gap:8px}
.w-selected-store [data-phone-tool]{background:transparent;color:#126c50;border:0;padding:4px;font-weight:700;white-space:nowrap}
.w-selected-store [data-phone-tool] span{font-size:30px;vertical-align:middle}
.phone-tool-buttons{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin:12px 0}
.phone-tool-buttons button{background:#173b4c;color:white;border:0;border-bottom:4px solid #092634;border-radius:9px;font-weight:800;padding:13px 2px;font-size:14px}
#phone-tool-dialog{width:min(620px,94vw);max-height:90dvh;overflow:auto;border:0;border-radius:16px;padding:16px;box-sizing:border-box}
#phone-tool-dialog::backdrop{background:#102b3b99}
#phone-tool-dialog>header{display:flex;align-items:center;justify-content:space-between;gap:8px;position:sticky;top:-16px;background:white;z-index:2;padding:8px 0}
#phone-tool-dialog h2{font-size:19px}#phone-tool-dialog>#smartphone2-loss>summary,#phone-tool-dialog>#smartphone2-mail>summary{display:none}
#phone-tool-dialog label{display:block;margin:8px 0}#phone-tool-dialog input:not([type=checkbox]),#phone-tool-dialog select{width:100%;box-sizing:border-box;min-height:42px}
.phone-tool-fields{display:grid;grid-template-columns:1fr 1fr;gap:8px}
#phone-tool-dialog .phone-special-offer{display:flex;align-items:center;gap:10px;min-height:44px;padding:8px 12px;border:1px solid #c17b14;border-radius:8px;background:#fff7df;color:#694000;font-weight:700}
.market-special-badge{display:inline-block;padding:2px 7px;border-radius:5px;background:#fff0c2;color:#754500;font-size:.9em;white-space:nowrap}
#phone-tool-host fieldset,.phone-tool-record{margin:12px 0;padding:12px;border:1px solid #ccd8dd;border-radius:8px}
#phone-tool-host button{padding:12px;background:#128463;color:white;border:0;border-radius:8px}
.phone-tool-error{color:#b42318;background:#fff0ef;padding:12px;font-weight:bold}.phone-tool-success{color:#06734f;font-weight:bold}
.phone-market-basis-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
#phone-tool-host .phone-market-basis-fields label{min-width:0;margin:4px 0;font-size:14px}
#phone-tool-host .phone-market-basis-fields select{min-height:44px;font-size:16px}
.phone-market-settings-note{font-size:14px;line-height:1.5;margin:8px 0}
.phone-market-settings-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin:12px 0;position:sticky;top:56px;z-index:1;padding:8px 0;background:white;border-bottom:1px solid #d8e3df}
#phone-tool-host .phone-market-settings-actions button{min-height:44px;padding:10px 4px;font-size:14px}
#phone-tool-host [data-market-settings]{background:#e8f3ef;color:#086349;border:1px solid #9dcbb9;width:100%;text-align:left;font-weight:700}
#phone-tool-host [data-preferences-close]{background:#e9eef0;color:#173b4c}
#phone-tool-host [data-preferences-load]{background:transparent;color:#315e70;min-height:44px;padding:8px 0;font-size:14px;text-decoration:underline}
#phone-tool-host button:disabled,#phone-tool-host select:disabled{opacity:.55;cursor:wait}
#phone-tool-host [data-market-preferences] h3{margin-top:4px}
#phone-tool-host legend label{display:flex;align-items:center;gap:8px}
#phone-tool-host input[type=checkbox]{width:22px;min-height:22px;height:22px;flex:none;margin:0}
