/* Rebuilt screens (web/screens/). The demo's look (lifted.css) and the type layer (calm.css)
   underneath; only what these pages add is here. */

/* The project page's facts strip: each fact is the control that changes it. */
.pj-facts{margin-top:6px;grid-template-columns:repeat(auto-fill,minmax(210px,1fr))}
.pj-grow{resize:none;field-sizing:content;min-height:0;line-height:1.4;display:block}
.pj-facts .pj-wide{grid-column:span 2}
.pj-in{font:inherit;font-size:var(--fs-2,13px);font-weight:500;color:var(--ink);width:100%;min-width:0;
  background:transparent;border:1px solid transparent;border-radius:6px;padding:4px 6px;margin-inline-start:-7px}
.pj-in.overdue{color:var(--risk)}
.pj-in:hover{border-color:var(--line)}
.pj-in:focus{outline:none;border-color:var(--ink);background:var(--panel)}
select.pj-in{cursor:pointer}
/* The brief's boxes are empty until typed in, so they show as boxes, like the add lines below. */
.pj-in[data-brief]{border-color:var(--line);background:var(--panel);padding:6px 9px;margin-inline-start:0}
.pj-in[data-brief]:hover{border-color:var(--muted)}
.pj-in[data-brief]:focus{border-color:var(--ink)}
.pj-note{min-height:0;margin-top:6px;color:var(--muted)}
.pj-note:empty{display:none}
.pj-note.bad{color:var(--risk)}

/* Items: one line each. The status is a word with a colour; a ready date that has passed
   while the item is not on its way is red, and nothing else marks it here. */
.pj-items th,.pj-items td{padding-inline:8px}
.pj-item{max-width:230px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.pj-st{font-weight:500}
.pj-development{background:#F2F4F7;color:#475467}
.pj-sample{background:#FEF6E7;color:#93370D}
.pj-approved{background:#EEF4FF;color:#3538CD}
.pj-production{background:#EFF8FF;color:#175CD3}
.pj-shipped,.pj-delivered{background:#ECFDF3;color:#067647}
.pj-ready{background:#F0FDF9;color:#107569}
.pj-cancelled{background:#F2F4F7;color:#98A2B3;text-decoration:line-through}

/* Projects list: the four chips above the table. */
.bd-chips{display:flex;gap:8px;flex-wrap:wrap;margin:0 0 12px}
.bd-chip{display:inline-flex;align-items:center;gap:6px;padding:5px 12px;border:1px solid var(--line);border-radius:999px;
  background:var(--panel);color:var(--ink);font-size:var(--fs-2,13px);font-weight:500;text-decoration:none}
.bd-chip:hover{border-color:var(--ink)}
.bd-chip .c{color:var(--muted);font-weight:400}
.bd-chip.on{background:var(--ink);border-color:var(--ink);color:#fff}
.bd-chip.on .c{color:rgba(255,255,255,.75)}
.bd-picks{display:inline-flex;gap:8px;flex-wrap:wrap;margin-inline-start:auto}
.bd-pick{font:inherit;font-size:var(--fs-2,13px);color:var(--ink);background:var(--panel);border:1px solid var(--line);
  border-radius:999px;padding:5px 10px;cursor:pointer;max-width:190px}
.bd-pick.on{border-color:var(--ink);font-weight:600}

/* Tasks: one line each with its box, and one line to add one. */
.pj-task{display:flex;gap:10px;align-items:baseline;padding:6px 0;border-bottom:1px solid var(--line2);cursor:pointer}
.pj-task input{margin:0;flex:none;position:relative;top:1px;accent-color:var(--ink)}
.pj-task .pj-tt{flex:1 1 auto;min-width:0}
.pj-task.done .pj-tt{color:var(--muted);text-decoration:line-through}
.pj-task.done{cursor:default}
.pj-addtask,.pj-additem{display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin-top:8px}
.pj-additem{padding:0 16px 14px}
.pj-addtask input,.pj-addtask select,.pj-additem input{font:inherit;font-size:var(--fs-2,13px);border:1px solid var(--line);border-radius:6px;padding:6px 9px;background:var(--panel)}
.pj-addtask input[name=title],.pj-additem input[name=name]{flex:1 1 200px;min-width:0}
/* The × on an item typed here takes it off the project again. */
.pj-x{font:inherit;font-size:15px;line-height:1;color:var(--muted);background:none;border:0;cursor:pointer;padding:0 4px;margin-inline-start:6px;vertical-align:middle}
.pj-x:hover{color:var(--risk)}
.pj-addnote{display:flex;gap:8px;align-items:flex-end;margin-bottom:10px}
.pj-addnote select{font:inherit;font-size:var(--fs-2,13px);border:1px solid var(--line);border-radius:8px;padding:6px 8px;background:var(--card,#fff)}
.pj-srcfilter{margin:0 0 10px}
.pj-addnote textarea{flex:1 1 auto;min-width:0;font:inherit;font-size:var(--fs-2,13px);border:1px solid var(--line);
  border-radius:6px;padding:6px 9px;background:var(--panel);resize:vertical}

/* The rail: a long stage name wraps to two lines instead of running into its neighbour. */
.pj-rail .rstage{padding-inline:6px;max-width:112px}

/* Date fields: a calendar mark at the end, and the browser's calendar opens on a click. */
.pj-datewrap{position:relative;display:inline-block}
.pj-date,.pj-addtask input.pj-date,.pj-in.pj-date:focus{cursor:pointer;padding-inline-end:26px;
  background-repeat:no-repeat;background-position:right 7px center;background-size:14px;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23667085' stroke-width='2' stroke-linecap='round'%3E%3Crect x='3' y='5' width='18' height='16' rx='2'/%3E%3Cpath d='M3 10h18M8 3v4M16 3v4'/%3E%3C/svg%3E")}
[dir="rtl"] .pj-date,[dir="rtl"] .pj-addtask input.pj-date,[dir="rtl"] .pj-in.pj-date:focus{background-position:left 7px center}
.pj-cal{position:absolute;inset-inline-start:0;bottom:0;width:1px;height:1px;opacity:0;pointer-events:none;border:0;padding:0}

/* Items: the latest version's picture at the start of the row, and the product group each
   production line covers as a heading over its items. A note's group tag lights them up. */
.pj-thumbcell{width:46px;padding-block:4px!important}
.pj-thumb{width:36px;height:36px;object-fit:cover;border-radius:6px;display:block;background:var(--soft)}
tr.pj-group td{background:var(--soft);font-size:12.5px;padding-block:7px}
tr.pj-lit td{background:var(--link-bg)}
.pj-feed .when{min-width:52px}
.pj-src{display:flex;gap:6px;align-items:center;margin-bottom:2px}

/* The item page: the version's picture beside its facts, pictures side by side for what
   changed, and the list of versions. A picture opens full size in a new tab. */
.vr-top{display:flex;gap:18px;align-items:flex-start;flex-wrap:wrap}
.vr-pic{width:220px;height:220px;object-fit:contain;border-radius:10px;background:var(--soft);display:block}
.vr-mid{width:100%;max-width:220px;height:180px;object-fit:contain;border-radius:8px;background:var(--soft);display:block}
.vr-msgpic{width:120px;height:90px;object-fit:cover;border-radius:6px;margin-top:6px;display:block}
.vr-nopic{border:1px dashed var(--line)}
.cl-logo{height:28px;max-width:96px;object-fit:contain;vertical-align:middle;margin-inline-end:6px;border-radius:4px;background:#fff}
.vr-addphoto{cursor:pointer}
.vr-byphoto{margin-top:10px}
.vr-facts{flex:1;min-width:240px}
.vr-list td{vertical-align:middle}
.vr-h{font-size:13px;font-weight:600;margin:0 0 6px}
.vr-pair{display:grid;grid-template-columns:1fr 1fr;gap:14px;margin:14px 0}
.vr-pair figure{margin:0}
.vr-pair .vr-mid{max-width:none;height:260px}
.vr-pair figcaption{margin-top:6px;font-size:12.5px}
.vr-diff td,.vr-diff th{padding-inline:10px;text-align:start}

/* The project's last stage: one button to mark it done, and the way back once it is. */
.pj-finish{display:flex;gap:10px;align-items:center;justify-content:flex-end;margin-top:12px}
.pj-finish span{font-weight:600;color:var(--ok, #067647)}

/* Pricing: the view switch above the sheet, the project's other sheets, and the summary row. */
.pr-bar{display:flex;align-items:center;gap:10px;margin:0 0 14px}
.pr-sibs{margin:0 0 14px}
.pr-foot{margin-top:16px}
.pr-foot .panel{max-width:460px;margin-inline-start:auto}
#pt td:nth-child(2),#ft td:nth-child(2){min-width:200px}
/* On a sheet typed here, the weight and the carton are typed on the line, under its chargeable
 * weight, each box under its own word. */
.pr-wt{display:flex;gap:4px;align-items:flex-end;margin-top:4px;white-space:nowrap}
.pr-wt label{display:flex;flex-direction:column;align-items:center;gap:2px;font-size:10px;line-height:1.2;color:var(--muted)}
.pr-wt input{font:inherit;font-size:11px;font-variant-numeric:tabular-nums;width:44px;text-align:center;
  border:1px solid var(--line2);border-radius:5px;padding:2px 2px;background:#fff}
.pr-wt .x{color:var(--faint);font-size:10px;padding-bottom:5px}

/* the Product Library */
.lb-find{width:220px;padding:6px 10px;border:1px solid var(--line);border-radius:8px;background:var(--panel);font:inherit}
.lb-tiles,.lb-results .catgrid{grid-template-columns:repeat(auto-fill,minmax(170px,1fr));gap:12px}
.lb-tile,.lb-card{padding:10px}
.lb-tile h3,.lb-card h3{font-size:13px;line-height:1.3}
.lb-photo{display:block;width:100%;aspect-ratio:1;object-fit:contain;border-radius:6px;margin-bottom:8px;background:#fff}
.lb-nopic{border:1px dashed var(--line2);background:var(--soft)}
.lb-h{font-size:var(--fs-2);margin:18px 0 8px}
.lb-cat:first-child .lb-h{margin-top:0}
.lb-table td:nth-child(2){max-width:120px;overflow-wrap:anywhere}
.lb-table td:nth-child(3){min-width:150px}
.lb-big{width:220px;aspect-ratio:1;object-fit:cover;border-radius:9px;border:1px solid var(--line);flex:none}
@media (max-width:720px){.lb-big{width:100%}.lb-find{width:100%}}

/* a supplier */
.sp-cols{display:grid;grid-template-columns:minmax(0,1fr) 320px;gap:16px;align-items:start}
.sp-contact+.sp-contact{margin-top:14px;padding-top:14px;border-top:1px solid var(--line)}
.sp-contact{grid-template-columns:1fr}
.sp-done>summary{cursor:pointer;list-style:none}
/* one column on a narrow screen: the contacts come first (a phone is how Ofir reaches the factory),
   and nothing in the column can widen the page past the screen */
.sp-main,.sp-side{min-width:0}
@media (max-width:900px){.sp-cols{grid-template-columns:minmax(0,1fr)}.sp-side{order:-1}}

/* Admin */
.ad-dec{display:inline-flex;gap:6px;align-items:center;margin-inline-end:18px}
.ad-tools{display:grid;grid-template-columns:repeat(auto-fill,minmax(180px,1fr));gap:10px}
.ad-tools .catcard{padding:12px 14px}
.ad-rgroup td{font-weight:600;padding-top:14px}
.ad-rfolder{max-width:340px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
/* the suppliers list: each count sits centred under its title */
.sp-list th:not(:first-child),.sp-list td.num{text-align:center}

/* the fix-once table: values read as text until the row is touched */
.ad-fix td{vertical-align:middle;transition:background-color .6s ease}
.ad-pick{position:relative;display:inline-flex;align-items:center;border-radius:7px;border:1px solid transparent;
  transition:border-color .15s,background-color .15s}
.ad-pick select{appearance:none;-webkit-appearance:none;font:inherit;font-size:13px;color:var(--ink);background:transparent;
  border:0;padding:5px 10px;padding-inline-end:28px;cursor:pointer;min-width:100px;border-radius:7px}
.ad-pick::after{content:"";position:absolute;inset-inline-end:11px;top:50%;width:5px;height:5px;margin-top:-4px;
  border-right:1.5px solid var(--faint);border-bottom:1.5px solid var(--faint);transform:rotate(45deg);pointer-events:none}
.ad-pick.unset select{color:var(--faint)}
.ad-fix tr:hover .ad-pick,.ad-pick:focus-within{border-color:var(--line);background:var(--panel)}
.ad-pick:focus-within{border-color:var(--link);box-shadow:0 0 0 3px var(--link-bg)}
.ad-pick select:focus{outline:none}
.ad-pick select option{color:var(--ink)}

/* status: the one coloured thing on the page */
.ad-status,.ad-status select{border-radius:999px}
.ad-status select{padding-inline-start:25px;font-weight:500}
.ad-status::before{content:"";position:absolute;inset-inline-start:11px;top:50%;width:7px;height:7px;margin-top:-3.5px;
  border-radius:50%;background:var(--gray-dot);opacity:.5;pointer-events:none}
.ad-status[data-tone="ok"]{background:var(--ok-bg);border-color:var(--ok-line)}
.ad-status[data-tone="ok"]::before{background:var(--ok-dot);opacity:1}
.ad-status[data-tone="ok"] select{color:var(--ok)}
.ad-status[data-tone="link"]{background:var(--link-bg);border-color:#C7D7FE}
.ad-status[data-tone="link"]::before{background:var(--link);opacity:1}
.ad-status[data-tone="link"] select{color:var(--link)}
.ad-status[data-tone="warn"]{background:var(--warn-bg);border-color:#FEDF89}
.ad-status[data-tone="warn"]::before{background:var(--warn-dot);opacity:1}
.ad-status[data-tone="warn"] select{color:var(--warn)}
.ad-status[data-tone="risk"]{background:var(--risk-bg);border-color:#FECDCA}
.ad-status[data-tone="risk"]::before{background:var(--risk-dot);opacity:1}
.ad-status[data-tone="risk"] select{color:var(--risk)}

/* the date: day first, the calendar opens on click */
.ad-date{position:relative;display:inline-flex;align-items:center;gap:8px;flex-wrap:wrap}
.ad-date input[type=date]{position:absolute;inset-inline-start:0;bottom:0;width:1px;height:1px;opacity:0;pointer-events:none;border:0;padding:0}
.ad-day{font:inherit;font-size:13px;font-variant-numeric:tabular-nums;color:var(--ink);background:transparent;cursor:pointer;
  border:1px solid transparent;border-radius:7px;padding:5px 10px;min-width:84px;text-align:start}
.ad-day.empty{color:var(--faint)}
.ad-fix tr:hover .ad-day,.ad-day:focus-visible{border-color:var(--line);background:var(--panel)}
.ad-day:focus-visible{outline:none;border-color:var(--link);box-shadow:0 0 0 3px var(--link-bg)}
.ad-use{display:inline-flex;align-items:center;gap:5px;font:inherit;font-size:12px;font-variant-numeric:tabular-nums;
  color:var(--link);background:var(--link-bg);border:1px dashed #B2CCFF;border-radius:999px;padding:3px 10px;cursor:pointer}
.ad-use svg{width:12px;height:12px;flex:none}
.ad-use:hover{border-style:solid}
.ad-use:focus-visible{outline:2px solid var(--link);outline-offset:2px}

.ad-fix td.ad-saved{background:var(--ok-bg);transition:none}
@media (prefers-reduced-motion:reduce){.ad-fix td,.ad-pick{transition:none}}
/* each control as wide as its value; an unset one is just its chevron until the row is touched */
.ad-pick select{field-sizing:content;min-width:0}
.ad-pick.unset select{color:transparent;min-width:64px}
.ad-pick.unset.ad-status::before{opacity:0}
.ad-fix tr:hover .ad-pick.unset select,.ad-pick.unset:focus-within select{color:var(--faint)}
.ad-fix tr:hover .ad-pick.unset.ad-status::before,.ad-pick.unset.ad-status:focus-within::before{opacity:.5}
.ad-fix tr:hover .ad-status[data-tone="ok"]{background:var(--ok-bg)}
.ad-fix tr:hover .ad-status[data-tone="link"]{background:var(--link-bg)}
.ad-fix tr:hover .ad-status[data-tone="warn"]{background:var(--warn-bg)}
.ad-fix tr:hover .ad-status[data-tone="risk"]{background:var(--risk-bg)}
.ad-day.late{color:var(--risk);font-weight:500}
.ad-date{flex-wrap:nowrap;white-space:nowrap}
.ad-fix td:has(.ad-date){min-width:220px}

/* a box on an item row: the figure as it reads, a border on hover, a field on focus */
.pj-cell{font:inherit;font-size:var(--fs-2,13px);color:var(--ink);background:transparent;border:1px solid transparent;border-radius:6px;padding:3px 6px;min-width:0;max-width:100%}
.pj-cell:hover{border-color:var(--line)}
.pj-cell:focus{outline:none;border-color:var(--ink);background:var(--panel)}
.pj-cell.overdue{color:var(--risk)}
.pj-name{width:100%;min-width:140px}.pj-ref{width:128px}.pj-sup{width:132px}.pj-qty{width:60px}.pj-price{width:76px}.pj-ready{width:92px}

/* a contact detail on the supplier page: a box that reads as the value and saves when left */
.sp-v{display:flex;align-items:flex-start;gap:6px}
.sp-cell{font:inherit;font-size:var(--fs-2,13px);color:var(--ink);background:transparent;border:1px solid transparent;border-radius:6px;padding:3px 6px;min-width:0;flex:1}
/* A long email or address wraps onto a second line instead of being cut off mid-word. */
textarea.sp-cell{resize:none;overflow:hidden;field-sizing:content;min-height:0;line-height:1.4;overflow-wrap:anywhere;white-space:pre-wrap}
.sp-cell:hover{border-color:var(--line)}
.sp-cell:focus{outline:none;border-color:var(--ink);background:var(--panel)}
.sp-go{flex:none;text-decoration:none}
.pj-cell.bad,.sp-cell.bad{border-color:var(--risk)}
.cellnote-row td{padding-top:0;padding-bottom:6px;border-top:0}
.cellnote{font-size:var(--fs-3,12px);color:var(--risk);margin-top:2px}

/* sheet view (#/file/<id>): a spreadsheet's grid as Excel saved it */
.sv-grid{overflow:auto;max-height:78vh}
.sv-table{border-collapse:collapse;font-size:12.5px;white-space:nowrap}
.sv-table td{border:1px solid var(--line,#e6e6e6);padding:3px 8px;max-width:360px;overflow:hidden;text-overflow:ellipsis;vertical-align:top}
.sv-table td.num{text-align:right;font-variant-numeric:tabular-nums}
.sv-tabs{display:flex;flex-wrap:wrap;gap:4px;padding:10px 12px 0}
.sv-tabs .tab{border:1px solid var(--line,#e6e6e6);background:transparent;border-radius:8px;padding:4px 10px;cursor:pointer;font:inherit;font-size:13px}
.sv-tabs .tab.hid{color:var(--muted,#667085);border-style:dashed}
.sv-tabs .tab.on{background:var(--ink,#111);color:#fff;border-color:var(--ink,#111)}

/* shipments: the table fits the screen; long text wraps, dates stay on one line, the edit row wraps */
.sh-tbl{width:100%;table-layout:auto}
.sh-tbl th,.sh-tbl td{white-space:normal;padding-inline:8px;overflow-wrap:break-word}
.sh-tbl td:first-child{min-width:150px}
.sh-tbl td.num,.sh-tbl td .num{white-space:nowrap}
.sh-tbl td .sh-trk{white-space:normal;overflow-wrap:break-word}
.sh-tbl td.sh-pack{white-space:normal;min-width:90px}.sh-tbl td.sh-pack bdi{white-space:nowrap}
.sh-tbl tr.sh-edit td:first-child{position:static;max-width:0;width:100%;overflow:visible}
.sh-tbl .sh-grid,.sh-tbl .sh-grid>*{min-width:0}
.sh-tbl .sh-grid input,.sh-tbl .sh-grid select{max-width:100%;box-sizing:border-box}
/* on a phone the form opens in its own full-width panel above the list (shipments.js) */
.sh-solo{margin-bottom:16px;scroll-margin-top:120px}.sh-solo .p-body{padding-top:4px}
.sh-solo .sh-tbl .sh-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
.sh-solo .sh-tbl tr.sh-edit td:first-child{min-width:0;padding-inline:0}
.sh-solo .sh-tbl tr.sh-edit:hover td{background:none}
/* Technical versions: the decision tag wraps under the summary instead of widening the box. */
.vr-list{width:100%}
.vr-list td.muted{white-space:normal;overflow-wrap:anywhere}
.vr-list td{padding-inline:8px}
.vr-list .tag{white-space:normal}

/* number tiles: a figure never breaks over two lines. A tile is never narrower than its figure,
   so when a row of tiles does not fit, the tiles wrap onto a second row (at every width) instead
   of running off the screen or printing over each other. The -1px margins tuck each tile's
   row-end and bottom rule under the strip's clipped edge, so only rules between tiles show. */
.stats .stat .v{white-space:nowrap}
.stats{flex-wrap:wrap;overflow:hidden}
.stats .stat{flex:1 1 0;min-width:min-content;border-inline-end:1px solid var(--line2);
  border-block-end:1px solid var(--line2);margin-inline-end:-1px;margin-block-end:-1px}
@media (max-width:600px){
  .stats{flex-wrap:wrap;overflow:hidden}
  .stats .stat{flex:1 1 50%;min-width:0;box-sizing:border-box;padding:10px 14px;border-block-end:1px solid var(--line2);margin-block-end:-1px}
  .stats .stat:nth-child(2n){border-inline-end:none}
  .stats .stat .v{font-size:17px}
}
/* Production Risk on a phone: the client and collection columns keep a readable width and
   the table scrolls sideways, instead of one word per line. */
@media (max-width:600px){table.risk-tbl td:first-child{min-width:210px}table.risk-tbl td:nth-child(3){min-width:130px}}
