:root{
  --bg:#f2f4f5;--card:#fff;--ink:#252728;--muted:#72797e;--border:#d9dddf;
  --green:#58b875;--dark:#292a2f;--accent:#e8b84b;--danger:#b23a3a;
  --fdv-panel-control-size:28px;--fdv-panel-control-row:43px;
}
*{box-sizing:border-box} body{margin:0;background:var(--bg);color:var(--ink);font:15px/1.4 system-ui,-apple-system,Segoe UI,Roboto,sans-serif}
.topbar{height:68px;background:var(--dark);color:white;display:flex;align-items:center;justify-content:space-between;padding:0 28px;position:sticky;top:0;z-index:20}
.brand{display:flex;align-items:center;gap:14px}.brand img{height:42px;max-width:250px;object-fit:contain}.userbar{display:flex;gap:16px;align-items:center}
button,a{font:inherit}.linkbtn{background:none;border:0;color:#fff;text-decoration:underline;cursor:pointer}
.page{max-width:1300px;margin:0 auto;padding:28px}.page-head,.call-head{display:flex;justify-content:space-between;gap:20px;align-items:center}
h1{margin:.15rem 0;font-size:32px}h2{font-size:18px}.muted,.small,.eyebrow{color:var(--muted)}.eyebrow{font-size:12px;font-weight:700;letter-spacing:.14em}
.search{display:flex;gap:10px;margin:24px 0}.search input{flex:1}
input,textarea,select{width:100%;border:1px solid var(--border);border-radius:7px;background:#fff;padding:11px 12px;font:inherit}
textarea{min-height:92px;resize:vertical}input:disabled,textarea:disabled{background:#f7f8f8;color:#43484b}
.primary,.secondary{border-radius:7px;padding:10px 15px;border:0;text-decoration:none;display:inline-block;cursor:pointer}
.primary{background:var(--green);color:#fff}.secondary{background:#fff;border:1px solid var(--border);color:var(--ink)}
.ticket-list{background:#fff;border:1px solid var(--border);border-radius:10px;overflow:hidden}.ticket-row{display:grid;grid-template-columns:180px 1fr 160px;gap:16px;padding:15px 18px;border-bottom:1px solid var(--border);color:var(--ink);text-decoration:none}.ticket-row:hover{background:#f7faf8}
.workspace{display:grid;grid-template-columns:minmax(0,1fr) 360px;min-height:calc(100vh - 68px)}
.call-panel{padding:26px 30px 60px;min-width:0}.history-panel{background:#fff;border-left:1px solid var(--border);max-height:calc(100vh - 68px);position:sticky;top:68px;overflow:auto}
.call-head{margin-bottom:22px}.actions{display:flex;gap:10px;align-items:center}.readonly{font-weight:700;color:#955b00;background:#fff0ce;padding:8px 11px;border-radius:6px}
.label-print-button{display:inline-flex;align-items:center;justify-content:center;width:auto;height:auto;margin-left:10px;padding:7px 13px;font-size:13px;line-height:1.2;vertical-align:middle;cursor:pointer;white-space:nowrap}.dymo-status{margin:-10px 0 16px;padding:8px 11px;border:1px solid #e1b6b6;border-radius:6px;background:#fff2f2;color:#7f2525}.dymo-status.is-success{border-color:#add4b8;background:#effaf1;color:#236b35}
.dymo-diagnostic{margin:-8px 0 16px;font-size:12px;padding:6px 10px}
.dymo-actions{display:flex;flex-wrap:wrap;gap:8px;align-items:center}.dymo-actions .dymo-diagnostic{margin:-8px 0 16px}.dymo-diagnostics-report{max-height:320px;overflow:auto;margin:-8px 0 16px;padding:10px;border:1px solid var(--border);border-radius:6px;background:#f7f8fa;color:#1f2933;font:11px/1.45 ui-monospace,SFMono-Regular,Consolas,monospace;white-space:pre-wrap;overflow-wrap:anywhere}
.back-to-calls{display:inline-block;margin:0 0 12px;color:#287da9;text-decoration:none;font-weight:700}.back-to-calls:hover{text-decoration:underline}
.whatsapp-unavailable{max-width:150px;color:var(--danger);font-size:12px;line-height:1.2}.whatsapp-dialog{width:min(520px,calc(100vw - 28px));padding:0;border:0;border-radius:12px;box-shadow:0 18px 55px rgba(0,0,0,.28)}.whatsapp-dialog::backdrop{background:rgba(25,28,30,.5)}.whatsapp-dialog-card{display:grid;gap:14px;padding:20px}.whatsapp-dialog-head{display:flex;align-items:center;justify-content:space-between;gap:16px}.whatsapp-dialog-head h2{margin:0}.whatsapp-help,.whatsapp-status{margin:0;color:var(--muted);font-size:13px}.whatsapp-status{padding:9px 11px;border-radius:7px;background:#effaf1;color:#236b35}.whatsapp-fallback{justify-self:start}.whatsapp-dialog-actions{display:flex;justify-content:flex-end;gap:10px}.error-inline{margin:0;color:var(--danger);font-size:13px;font-weight:700}
.field-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:15px;background:#fff;border:1px solid var(--border);border-radius:12px;padding:20px}
.field span{display:block;font-size:12px;font-weight:700;text-transform:uppercase;letter-spacing:.05em;color:var(--muted);margin-bottom:5px}.field.wide{grid-column:1/-1}
.quick-actions{margin-top:20px;background:#fff;border:1px solid var(--border);border-radius:12px;padding:18px}.quick-actions h2{margin-top:0}.quick-actions form{display:grid;gap:10px}.two{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.history-head{display:flex;align-items:center;justify-content:space-between;padding:18px;border-bottom:1px solid var(--border)}.history-head h2{margin:0}.iconbtn{border:1px solid var(--border);background:#fff;border-radius:6px;padding:6px 9px}
.history-list{padding:12px}.history-item{border:1px solid var(--border);border-radius:9px;padding:12px;margin-bottom:10px}.history-meta{font-size:11px;color:var(--muted);margin-bottom:8px}.history-body{overflow-wrap:anywhere}.history-body img{max-width:100%;height:auto}.attachments{display:grid;gap:3px;margin-top:8px;font-size:12px}
.workspace.history-hidden{grid-template-columns:1fr}.workspace.history-hidden .history-panel{display:none}
.login-wrap{min-height:calc(100vh - 68px);display:grid;place-items:center;padding:20px}.login-card{width:min(520px,100%);background:#fff;border:1px solid var(--border);border-radius:12px;padding:28px}.login-card form{display:grid;gap:10px}
.error{background:#ffe4e4;color:#872b2b;border:1px solid #efb4b4;padding:10px;border-radius:7px;margin:12px 0}.readonly-box{padding:12px;background:#f2f4f5;border-radius:7px;color:var(--muted)}
.fdv-toast{position:fixed;top:84px;right:22px;z-index:120;min-width:150px;padding:10px 14px;border:1px solid #b8d7c2;border-left:4px solid var(--green);border-radius:7px;background:#fff;color:var(--ink);box-shadow:0 8px 24px rgba(0,0,0,.16);font-weight:700}
.fdv-toast[hidden]{display:none}
@media(max-width:900px){.workspace{grid-template-columns:1fr}.history-panel{position:static;max-height:none;border-left:0;border-top:1px solid var(--border)}.field-grid{grid-template-columns:1fr}.ticket-row{grid-template-columns:1fr}.call-head{align-items:flex-start;flex-direction:column}}

/* --- Smartsheet-style call list v2 --- */
.sheet-shell{
  display:grid;
  grid-template-columns:260px 280px minmax(0,1fr);
  min-height:calc(100vh - 68px);
  background:#fff;
}
.nav-rail{
  background:#2b2c31;
  color:#fff;
  display:flex;
  flex-direction:column;
  min-width:0;
  border-right:1px solid #202126;
}
.rail-top{height:var(--fdv-panel-control-row);padding:0 14px;border-bottom:1px solid #383a40;display:flex;align-items:center;justify-content:flex-start}
.rail-collapse{width:var(--fdv-panel-control-size);height:var(--fdv-panel-control-size);border:0;background:#3a3c43;color:#fff;border-radius:6px;padding:0;display:grid;place-items:center;line-height:1;cursor:pointer}
.rail-menu{display:grid;padding-top:8px}
.rail-item{display:flex;align-items:center;gap:12px;color:#e5e8ea;text-decoration:none;padding:12px 16px}
.rail-item[type="button"]{border:0;background:transparent;cursor:pointer;text-align:left}
.rail-item:hover,.rail-item.active{background:#3ba0d6;color:#fff}
.rail-icon{width:24px;text-align:center;font-weight:800}
.rail-user{margin-top:auto;border-top:1px solid #383a40;padding:14px 16px;display:flex;align-items:center;gap:10px}
.avatar{width:34px;height:34px;border-radius:50%;background:#e8a749;color:#fff;display:grid;place-items:center;font-weight:700}

.overview-pane{background:#fff;border-right:1px solid var(--border);min-width:0}
.overview-head{height:var(--fdv-panel-control-row);display:flex;align-items:center;justify-content:space-between;padding:0 14px;border-bottom:1px solid var(--border)}
.overview-head .iconbtn{width:var(--fdv-panel-control-size);height:var(--fdv-panel-control-size);padding:0;display:grid;place-items:center;line-height:1}
.overview-list{display:grid}
.overview-item{display:flex;justify-content:space-between;align-items:center;border:0;border-bottom:1px solid var(--border);background:#fff;padding:13px 14px;text-align:left;color:#2788c2;cursor:pointer}
.overview-item:hover,.overview-item.active{background:#f2f4f5;color:#222}
.overview-item b{font-size:12px;color:#636a6f}

.sheet-main{min-width:0;overflow:hidden;background:#fff}
.sheet-toolbar{display:flex;gap:16px;justify-content:space-between;align-items:center;padding:15px 20px;border-bottom:1px solid var(--border);background:#fff}
.sheet-toolbar h1{font-size:22px;margin:0}
.sheet-search{display:flex;gap:8px;min-width:480px}
.sheet-search input{min-width:0}
.sheet-table-wrap{overflow:auto;height:calc(100vh - 145px);background:#fff}
.sheet-table{border-collapse:separate;border-spacing:0;width:max-content;min-width:100%;font-size:13px}
.fdv-row-context-menu{position:fixed;z-index:200;min-width:150px;padding:4px;border:1px solid #aeb5b9;border-radius:6px;background:#fff;box-shadow:0 8px 24px rgba(0,0,0,.2)}
.fdv-row-context-menu[hidden]{display:none}.fdv-row-context-menu a{display:block;padding:8px 10px;color:var(--ink);text-decoration:none;border-radius:4px}.fdv-row-context-menu a:hover,.fdv-row-context-menu a:focus{background:#eaf4fa;outline:0}
.bottom-save{margin-top:18px;align-self:flex-start}
.sheet-table th,.sheet-table td{
  border-right:1px solid #e1e4e6;
  border-bottom:1px solid #e1e4e6;
  padding:9px 10px;
  vertical-align:top;
  white-space:nowrap;
  background:#fff;
  max-width:340px;
  overflow:hidden;
  text-overflow:ellipsis;
}
.sheet-table thead th{
  position:sticky;top:0;z-index:6;
  background:#f4f6f6;color:#596167;
  font-size:11px;letter-spacing:.08em;text-align:left;
  font-weight:700;
}
.sheet-table tbody tr:hover td{background:#f7fbfd}
.sheet-table .select-col{width:42px;min-width:42px;text-align:center;position:sticky;left:0;z-index:5;background:#fff}
.sheet-table thead .select-col{z-index:9;background:#f4f6f6}
.call-link{font-weight:700;color:#3b88b5;text-decoration:none}.call-link:hover{text-decoration:underline}
.state-pill{display:inline-flex;align-items:center;gap:5px}
.state-pill::before{content:"";width:8px;height:8px;border-radius:50%;background:#e5a900;border:2px solid #fff;box-shadow:0 0 0 1px #c3c6c7}
.state-approved::before,.state-closed::before{background:#46b86c}
.state-new::before,.state-on-site::before{background:#e7a617}

.sheet-shell.rail-collapsed{grid-template-columns:58px 280px minmax(0,1fr)}
.sheet-shell.rail-collapsed .nav-rail .rail-label{display:none}
.sheet-shell.rail-collapsed .rail-item{justify-content:center;padding-left:0;padding-right:0}
.sheet-shell.rail-collapsed .rail-user{justify-content:center;padding-left:0;padding-right:0}
@media(max-width:1000px){
  .sheet-shell{grid-template-columns:58px 0 minmax(0,1fr)}
  .nav-rail .rail-label,.overview-pane{display:none}
  .sheet-search{min-width:280px}
}

/* === v3: intentionally close to the long-used Smartsheet sheet === */
.smartsheet-mode{
  font-family:var(--grid-font,Arial,Helvetica,sans-serif);
}
.compact-toolbar{
  min-height:54px;
  padding:8px 10px;
}
.compact-toolbar h1{
  font-family:Arial,Helvetica,sans-serif;
  font-size:20px;
  font-weight:700;
}
.smartsheet-mode .sheet-table-wrap{
  height:calc(100vh - 122px);
  background:#fff;
  border-top:1px solid #bfc3c5;
}
.exact-smartsheet{
  font-family:var(--grid-font,Arial,Helvetica,sans-serif);
  font-size:var(--grid-size,12px);
  line-height:1.15;
  border-collapse:separate;
  border-spacing:0;
  table-layout:auto;
  width:max-content;
  min-width:100%;
}
.exact-smartsheet th,
.exact-smartsheet td{
  padding:var(--grid-padding-y,4px) 6px;
  height:var(--grid-row-height,25px);
  min-height:var(--grid-row-height,25px);
  border-right:1px solid #bfc3c5;
  border-bottom:1px solid #bfc3c5;
  color:#000;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:clip;
  width:auto;
  min-width:0;
}
.exact-smartsheet thead th{
  height:42px;
  padding:6px 7px;
  background:#fff;
  color:#111;
  font-size:var(--grid-size,12px);
  font-weight:var(--grid-header-weight,700);
  letter-spacing:0;
  text-transform:none;
  vertical-align:middle;
  border-bottom:2px solid #aeb3b6;
}
.exact-smartsheet tbody td{
  background:var(--source-fill,#FFED00);
}
.exact-smartsheet .call-link{
  color:#000;
  font-weight:400;
  text-decoration:none;
}
.exact-smartsheet .call-link:hover{
  text-decoration:underline;
}
.smartsheet-mode .sheet-search{
  min-width:450px;
}
.smartsheet-mode .sheet-search input{
  height:34px;
  border-radius:3px;
}
.smartsheet-mode .sheet-search button{
  height:34px;
  border-radius:3px;
  padding:5px 14px;
}
.smartsheet-mode .overview-pane{
  font-family:Arial,Helvetica,sans-serif;
}
.smartsheet-mode .overview-head{
  height:var(--fdv-panel-control-row);
}
.smartsheet-mode .overview-item{
  min-height:36px;
  padding:8px 11px;
  font-size:13px;
}
@media(max-width:1000px){
  .smartsheet-mode .sheet-table-wrap{height:calc(100vh - 122px)}
}


/* The second left pane must never disappear completely. */
.sheet-shell.overviews-collapsed{
  grid-template-columns:260px 36px minmax(0,1fr) !important;
}
.sheet-shell.rail-collapsed.overviews-collapsed{
  grid-template-columns:58px 36px minmax(0,1fr) !important;
}
.sheet-shell.overviews-collapsed .overview-pane{
  display:block !important;
  width:36px;
  min-width:36px;
  overflow:hidden;
  border-right:1px solid var(--border);
  background:#fff;
}
.sheet-shell.overviews-collapsed .overview-list{
  display:none;
}
.sheet-shell.overviews-collapsed .overview-head{
  height:var(--fdv-panel-control-row);
  min-height:var(--fdv-panel-control-row);
  padding:0;
  display:flex;
  flex-direction:row;
  justify-content:center;
  align-items:center;
  gap:0;
}
.sheet-shell.overviews-collapsed .overview-head strong{
  display:none;
}
.sheet-shell.overviews-collapsed .overview-head .iconbtn{
  width:var(--fdv-panel-control-size);
  height:var(--fdv-panel-control-size);
  padding:0;
  font-size:18px;
  line-height:26px;
  background:#fff;
}

/* Do not let the mobile rule hide the reopen handle when user collapsed it. */
@media(max-width:1000px){
  .sheet-shell.overviews-collapsed .overview-pane{
    display:block !important;
  }
}



/* v7.1 final grid rules: one stacking model, two frozen columns only. */
.sheet-shell{height:calc(100vh - 68px);min-height:0;}
.sheet-main{display:flex;flex-direction:column;min-height:0;overflow:hidden;}
.compact-toolbar{flex:0 0 auto;}
.calls-grid-shell{display:flex;flex:1 1 auto;flex-direction:column;min-height:0;overflow:hidden;}
.sheet-table-wrap,.calls-grid-viewport{flex:1 1 auto;min-height:0;height:auto;overflow-x:hidden;overflow-y:auto;}
.exact-smartsheet thead{position:relative;z-index:20;}
.exact-smartsheet thead th{position:sticky;top:0;z-index:30;background:#fff !important;}
.exact-smartsheet tbody td{position:relative;z-index:1;background:var(--row-fill,#FFED00);color:var(--row-text,#000);}
.exact-smartsheet tbody tr:hover td{outline:1px solid rgba(80,100,110,.28);outline-offset:-1px;}
.exact-smartsheet thead th.col-call-ref,.exact-smartsheet tbody td.col-call-ref{position:sticky;left:0;}
.exact-smartsheet thead th.col-customer,.exact-smartsheet tbody td.col-customer{position:sticky;left:var(--call-ref-width,0px);}
.exact-smartsheet tbody td.col-call-ref,.exact-smartsheet tbody td.col-customer{z-index:12;}
.exact-smartsheet .col-customer{max-width:260px;}
.exact-smartsheet .col-contract{max-width:220px;}
.exact-smartsheet th:nth-child(8),.exact-smartsheet td:nth-child(8){max-width:280px;}
.exact-smartsheet th:nth-child(10),.exact-smartsheet td:nth-child(10){max-width:180px;}
.exact-smartsheet th:nth-child(11),.exact-smartsheet td:nth-child(11){max-width:260px;}
.exact-smartsheet th:nth-child(14),.exact-smartsheet td:nth-child(14),.exact-smartsheet th:nth-child(17),.exact-smartsheet td:nth-child(17){max-width:360px;}
.exact-smartsheet tbody .col-contract{position:static;z-index:auto;}
.exact-smartsheet thead .col-contract{position:sticky;top:0;}
.exact-smartsheet thead th.col-call-ref,.exact-smartsheet thead th.col-customer{z-index:50;background:#fff !important;}
.exact-smartsheet thead th.col-contract{z-index:31;background:#fff !important;}
.exact-smartsheet td.inline-editable{user-select:none;}
.exact-smartsheet td.inline-editable .inline-editor{user-select:text;position:relative;z-index:40;}
.exact-smartsheet tbody td.is-active-cell{outline:3px solid #111;outline-offset:-3px;box-shadow:inset 0 0 0 4px rgba(255,255,255,.92),inset 0 0 0 5px rgba(0,0,0,.35);z-index:25;}
.sheet-bottom-scroll,.calls-grid-hscroll{flex:0 0 20px;min-height:20px;display:block;overflow-x:scroll;overflow-y:hidden;background:#d8dcdf;border-top:1px solid #9ba2a6;scrollbar-color:#657078 #d8dcdf;scrollbar-width:auto;}
.sheet-bottom-scroll>div,.calls-grid-hscroll-spacer{height:1px;}
.sheet-bottom-scroll::-webkit-scrollbar{height:18px;}
.sheet-bottom-scroll::-webkit-scrollbar-track{background:#d8dcdf;border-top:1px solid #b4b9bc;}
.sheet-bottom-scroll::-webkit-scrollbar-thumb{background:#657078;border:3px solid #d8dcdf;border-radius:8px;}
.sheet-bottom-scroll.is-scrollable::-webkit-scrollbar-thumb:hover{background:#485158;}
.calls-grid-pagination{flex:0 0 auto;}
.sheet-shell.rail-collapsed .rail-top{padding:0;justify-content:center;text-align:center;}
.sheet-shell.rail-collapsed .rail-collapse{visibility:visible;padding:0;}


/* === v6 editable pilot === */
.inline-editable{
  cursor:text;
}
.inline-editable:hover{
  outline:2px solid rgba(44,137,190,.35);
  outline-offset:-2px;
}
.inline-editor{
  display:block;
  width:100%;
  min-width:100%;
  height:100%;
  min-height:23px;
  margin:-4px -6px;
  padding:4px 6px;
  border:2px solid #2d8bc0;
  border-radius:0;
  background:#fff;
  color:#000;
  font:inherit;
  line-height:1.15;
}
textarea.inline-editor{
  min-height:60px;
  resize:vertical;
}
td.saving{
  opacity:.6;
}
.edit-hint{
  font-size:11px;
  margin-top:2px;
}

/* v9 isolated Create Call form and KFC reference picker. */
.new-call-page{width:min(1120px,calc(100% - 40px));margin:0 auto;padding:26px 0 60px;}
.new-call-head{display:flex;align-items:center;justify-content:space-between;gap:24px;margin-bottom:18px;}
.new-call-head h1{margin:2px 0 0;}
.new-call-head p{margin:5px 0 0;}
.new-call-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:15px;background:#fff;border:1px solid var(--border);border-radius:12px;padding:20px;}
.new-call-grid .wide{grid-column:1/-1;}
.new-call-grid .field{position:relative;min-width:0;}
.new-call-grid .field>span{display:block;font-size:12px;font-weight:700;text-transform:uppercase;letter-spacing:.05em;color:var(--muted);margin-bottom:5px;}
.new-call-grid select[multiple]{min-height:112px;}
.new-call-actions{display:flex;align-items:center;gap:10px;padding-top:4px;}
.kfc-site-field{z-index:8;}
.kfc-site-field input.kfc-enabled{border-color:#8b6f00;box-shadow:0 0 0 2px rgba(232,184,75,.28);}
.kfc-hint{display:block;margin-top:5px;color:#6f5a00;}
.kfc-suggestions{position:absolute;top:calc(100% - 1px);left:0;right:0;max-height:290px;overflow:auto;background:#fff;border:1px solid #858b8f;border-radius:0 0 7px 7px;box-shadow:0 8px 22px rgba(0,0,0,.18);z-index:20;}
.kfc-suggestion{display:flex;width:100%;flex-direction:column;align-items:flex-start;gap:2px;padding:9px 11px;border:0;border-bottom:1px solid #e1e4e6;background:#fff;color:#222;text-align:left;cursor:pointer;}
.kfc-suggestion:last-child{border-bottom:0;}
.kfc-suggestion:hover,.kfc-suggestion.is-highlighted{background:#e8f4fb;}
.kfc-suggestion strong{font-size:13px;}
.kfc-suggestion small{color:#626a70;}
@media(max-width:760px){.new-call-grid{grid-template-columns:1fr}.new-call-grid .wide{grid-column:auto}.new-call-head{align-items:flex-start;flex-direction:column}.new-call-page{width:min(100% - 24px,1120px)}}

#calls-table tbody tr.is-newly-created-call > td{animation:fdv-new-call-arrival 4s ease-out;}
@keyframes fdv-new-call-arrival{0%,35%{box-shadow:inset 0 0 0 4px #0057b8}100%{box-shadow:inset 0 0 0 0 transparent}}

/* v10.7 row creation and recovery-gated deletion. Keep the existing grid geometry. */
.toolbar-title-block{min-width:0;}
.grid-row-actions{display:flex;align-items:center;flex-wrap:wrap;gap:7px;margin-top:7px;}
.grid-row-actions .compact-action{min-height:30px;padding:4px 10px;border-radius:3px;}
.draft-actions{display:inline-flex;align-items:center;gap:7px;}
.draft-actions[hidden]{display:none;}
.row-action-status{font-size:12px;}
button.danger{border:1px solid #a32727;background:#b72d2d;color:#fff;}
button.danger:hover:not(:disabled){background:#971f1f;}
button.danger:disabled{border-color:#b7b7b7;background:#d6d6d6;color:#777;cursor:not-allowed;}
.exact-smartsheet tbody tr.fdv-draft-row>td{background:#dcefff;color:#111;vertical-align:top;}
.exact-smartsheet tbody tr.fdv-draft-row>td.col-call-ref,
.exact-smartsheet tbody tr.fdv-draft-row>td.col-customer{z-index:13;}
.draft-cell{padding:2px 3px;overflow:visible;}
.draft-cell-control{display:block;width:100%;min-width:78px;height:26px;margin:0;padding:2px 4px;border:1px solid #6b879a;border-radius:2px;background:#fff;color:#111;font:inherit;}
.draft-cell-control:focus{position:relative;z-index:31;outline:2px solid #0057b8;outline-offset:-1px;}
.draft-new-marker{display:block;margin-bottom:2px;color:#0057b8;font-size:9px;font-weight:800;letter-spacing:.08em;}
.draft-readonly{display:block;padding:5px 4px;color:#62727c;}
.draft-kfc-suggestions{top:100%;right:auto;width:360px;max-width:min(80vw,520px);z-index:80;}
.delete-call-dialog{width:min(520px,calc(100vw - 32px));padding:0;border:0;border-radius:9px;box-shadow:0 18px 55px rgba(0,0,0,.38);}
.delete-call-dialog::backdrop{background:rgba(20,28,34,.55);}
.delete-dialog-card{padding:22px;}
.delete-dialog-card h2{margin:0 0 8px;}
.danger-copy{margin:0 0 17px;color:#8b1f1f;font-weight:700;}
.delete-call-summary{margin:0 0 17px;border:1px solid var(--border);border-radius:6px;}
.delete-call-summary>div{display:grid;grid-template-columns:145px 1fr;gap:10px;padding:8px 10px;border-bottom:1px solid var(--border);}
.delete-call-summary>div:last-child{border-bottom:0;}
.delete-call-summary dt{font-weight:700;}
.delete-call-summary dd{margin:0;overflow-wrap:anywhere;}
.delete-dialog-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:16px;}

/* DYMO LabelWriter 450, SKU 11355: 2 x 3/4in landscape. */
.label-page{width:50.8mm;height:19.05mm;margin:0;background:#fff;overflow:hidden}.label-card{width:50.8mm;height:19.05mm;padding:1.5mm 2mm;display:grid;grid-template-columns:11mm 1fr;grid-template-rows:5mm 8.5mm;column-gap:2mm;align-items:center}.label-logo{width:11mm;height:auto;max-height:5mm;object-fit:contain}.label-ref{font:700 4.2mm/1 Arial,sans-serif;white-space:nowrap;overflow:hidden}.label-barcode{grid-column:1/-1;width:46.8mm;height:8.5mm;display:block}.label-barcode rect{shape-rendering:crispEdges}
@media print{ @page{size:50.8mm 19.05mm;margin:0} html,body{width:50.8mm;height:19.05mm;margin:0;padding:0;background:#fff} .label-page{margin:0} }
#calls-table.exact-smartsheet tbody td.is-active-cell,
#calls-table.exact-smartsheet tbody td.is-active-cell:hover{
  outline:3px solid #111;
  outline-offset:-3px;
  box-shadow:inset 0 0 0 4px rgba(255,255,255,.92),inset 0 0 0 5px rgba(0,0,0,.35);
  z-index:25;
}

/* v14 server-backed Smartsheet views and grid settings. */
.overview-item{text-decoration:none}
.toolbar-menu{position:relative}
.toolbar-menu>summary{list-style:none;white-space:nowrap}
.toolbar-menu>summary::-webkit-details-marker{display:none}
.toolbar-menu:not(.is-open) .toolbar-menu-popover{display:none}
.toolbar-menu-popover{position:absolute;top:calc(100% + 4px);left:0;z-index:110;display:grid;min-width:230px;max-height:340px;overflow:auto;padding:6px;border:1px solid #aeb5b9;border-radius:6px;background:#fff;box-shadow:0 10px 28px rgba(0,0,0,.2)}
.toolbar-menu-popover a,.toolbar-menu-popover button{display:block;width:100%;padding:7px 9px;border:0;background:#fff;color:#222;text-align:left;text-decoration:none;cursor:pointer}
.toolbar-menu-popover a:hover,.toolbar-menu-popover button:hover{background:#eaf4fa}
.toolbar-menu-popover hr{width:100%;margin:5px 0;border:0;border-top:1px solid var(--border)}
.settings-dialog{width:min(840px,calc(100vw - 32px));padding:0;border:0;border-radius:10px;box-shadow:0 20px 65px rgba(0,0,0,.4)}
.settings-dialog-wide{width:min(1380px,calc(100vw - 32px))}
.settings-dialog::backdrop{background:rgba(25,32,37,.5)}
.settings-card{padding:20px}
.settings-head{display:flex;align-items:flex-start;justify-content:space-between;gap:20px;margin-bottom:14px}
.settings-head h2{margin:0}.settings-head p{margin:3px 0 0;color:var(--muted)}
.settings-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.settings-actions{display:flex;align-items:center;justify-content:flex-end;gap:9px;margin-top:16px}
.settings-subsection{display:flex;align-items:end;gap:16px;margin-top:14px;padding-top:12px;border-top:1px solid var(--border)}
.settings-subsection .field{flex:1}
.checkline{display:flex;align-items:center;gap:8px;white-space:nowrap}.checkline input{width:auto}
.error-inline{margin-right:auto;color:#9b2626;font-weight:700}
.filter-root-logic{width:220px;margin-bottom:10px}
.filter-builder-groups{display:grid;gap:10px}
.filter-group{padding:10px;border:1px solid var(--border);border-radius:7px;background:#fafbfb}
.filter-group-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:8px}
.filter-condition{display:grid;grid-template-columns:1.2fr 1fr 1.4fr 34px;gap:7px;margin-top:7px}
.filter-condition input,.filter-condition select{padding:7px 8px}
.mini-danger{border:0;background:#b72d2d;color:#fff;border-radius:5px;cursor:pointer}
.view-manage-row,.column-settings-row{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:10px;padding:8px;border-bottom:1px solid var(--border)}
.sort-indicator{font-size:12px;color:var(--muted);font-weight:700}
.view-manage-row{grid-template-columns:auto minmax(0,1fr) auto;transition:background .12s ease}.view-manage-row.is-dragging{opacity:.55}.view-manage-row.is-drop-target{background:#eaf4fa}.view-manage-drop-indicator{height:4px;margin:0 8px;border-radius:4px;background:#287da9;box-shadow:0 0 0 1px #fff}.view-manage-handle{width:30px;height:30px;padding:0;border:1px solid var(--border);border-radius:5px;background:#f8fafb;color:#596167;font-size:18px;line-height:1;cursor:grab}.view-manage-handle:active,.view-manage-handle.is-grabbing{cursor:grabbing}.view-order-help{margin:-7px 0 12px}.view-order-status{min-height:1.2em;margin:0 0 6px}.view-order-status.is-error{color:var(--danger)}
.view-manage-actions,.column-actions{display:flex;gap:5px}
.view-manage-actions button,.column-actions button{padding:4px 7px}
.column-settings-list{max-height:520px;overflow:auto;border:1px solid var(--border);border-radius:6px}
.column-settings-row .checkline{min-width:0}.column-settings-row .checkline span{overflow:hidden;text-overflow:ellipsis}
.conditional-preview{padding:10px;margin-bottom:10px;border:1px solid #999;background:#ffed00;color:#000}
.conditional-rules{display:grid;gap:6px;max-height:560px;overflow:auto}
.conditional-rule{display:grid;grid-template-columns:28px minmax(140px,1.4fr) 125px 105px minmax(120px,1fr) 90px 92px 92px auto;gap:5px;align-items:center;padding:6px;border:1px solid var(--border);border-radius:5px}
.conditional-rule input,.conditional-rule select{min-width:0;padding:6px}
.conditional-rule input[type=checkbox]{width:auto}.conditional-rule input[type=color]{height:34px;padding:2px}
.conditional-rule-actions{display:flex;gap:3px}.conditional-rule-actions button{padding:4px 6px}
.grid-lines-off .exact-smartsheet th,.grid-lines-off .exact-smartsheet td{border-right-color:transparent;border-bottom-color:transparent}
@media(max-width:900px){.settings-grid{grid-template-columns:1fr}.filter-condition{grid-template-columns:1fr}.conditional-rule{grid-template-columns:1fr 1fr}.settings-dialog{width:calc(100vw - 16px)}}

/* v14.2 visible shared grid toolbar + cleaner inline-edit state. */
.grid-toolbar-separator{width:1px;height:26px;background:#c8cdd0;margin:0 2px;}
.toolbar-field{display:inline-flex;align-items:center;margin:0;}
.toolbar-field select{
  min-height:30px;
  height:30px;
  padding:3px 24px 3px 8px;
  border:1px solid #aeb5b9;
  border-radius:3px;
  background:#fff;
  color:#222;
  font:inherit;
}
.toolbar-size-field select{min-width:58px;}
.sr-only{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important;border:0!important;}
#calls-table.exact-smartsheet tbody td.is-active-cell.is-editing,
#calls-table.exact-smartsheet tbody td.is-active-cell.is-editing:hover{
  outline:none;
  box-shadow:none;
}
#calls-table.exact-smartsheet tbody td.is-editing .inline-editor{
  outline:none;
  box-shadow:none;
}
@media(max-width:1180px){
  .grid-toolbar-separator{display:none;}
}

/* v17.1 reviewed Closing PDF and email workflow. */
.closing-actions>p{margin-top:-5px;}
.closing-action-buttons{display:flex;flex-wrap:wrap;gap:9px;margin-top:12px;}
.closing-dialog{width:min(880px,calc(100vw - 28px));max-height:calc(100vh - 28px);padding:0;border:0;border-radius:10px;box-shadow:0 20px 65px rgba(0,0,0,.42);}
.closing-dialog::backdrop{background:rgba(20,28,34,.58);}
.closing-dialog-card{display:grid;gap:14px;padding:22px;}
.closing-dialog-head{display:flex;align-items:flex-start;justify-content:space-between;gap:20px;}
.closing-dialog-head h2{margin:0;}.closing-dialog-head p{margin:4px 0 0;color:var(--muted);}
.closing-dialog-head .iconbtn{font-size:24px;line-height:1;}
.closing-presets{display:flex;flex-wrap:wrap;gap:7px;padding-bottom:10px;border-bottom:1px solid var(--border);}
.closing-field-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px;max-height:50vh;overflow:auto;padding:2px;}
.closing-field-list.compact{max-height:240px;}
.closing-field-choice{display:grid;grid-template-columns:20px minmax(0,1fr);gap:8px;align-items:start;padding:8px;border:1px solid var(--border);border-radius:6px;background:#fafbfb;cursor:pointer;}
.closing-field-choice:has(input:checked){border-color:#4e8f62;background:#edf7f0;}
.closing-field-choice input{width:auto;margin-top:2px;}.closing-field-choice small{display:block;margin-top:2px;color:var(--muted);white-space:pre-wrap;overflow-wrap:anywhere;}
.closing-dialog-actions{display:flex;align-items:center;justify-content:flex-end;gap:8px;padding-top:4px;}
.closing-email-dialog{width:min(920px,calc(100vw - 28px));}
.closing-email-dialog .field>span{display:block;margin-bottom:5px;font-size:12px;font-weight:700;text-transform:uppercase;letter-spacing:.05em;color:var(--muted);}
.closing-email-dialog textarea{min-height:120px;resize:vertical;}
.closing-email-pdf{margin:0;padding:12px;border:1px solid var(--border);border-radius:7px;}
.closing-email-pdf legend{padding:0 6px;font-weight:700;}.closing-email-pdf>p{margin:0 0 9px;}
.closing-send-warning{padding:10px 12px;border-left:4px solid #b57b00;background:#fff7df;color:#5e460d;font-weight:700;}
@media(max-width:700px){.closing-field-list{grid-template-columns:1fr}.closing-dialog-card{padding:15px}.closing-dialog-actions{flex-wrap:wrap}.closing-dialog-actions .error-inline{width:100%;}}

/* v17.2 normal username/password sign-in. */
.login-form{display:grid;gap:10px;}
.login-form input[type=text],.login-form input[type=password]{width:100%;box-sizing:border-box;}
.remember-row{display:flex;align-items:center;gap:8px;font-weight:400;}
.remember-row input{width:auto;}
.login-card .small{margin-top:14px;color:#64748b;}

/* === v17.5 mobile grid + dynamic loading === */
.grid-loading{
  position:absolute;
  z-index:30;
  top:8px;
  left:50%;
  transform:translateX(-50%);
  display:flex;
  align-items:center;
  gap:8px;
  padding:8px 12px;
  border:1px solid #cbd1d8;
  border-radius:6px;
  background:rgba(255,255,255,.96);
  box-shadow:0 2px 8px rgba(0,0,0,.12);
  font-size:13px;
}
.grid-loading[hidden]{display:none}
.grid-loading-spinner{
  width:14px;
  height:14px;
  border:2px solid #c8ced6;
  border-top-color:#555;
  border-radius:50%;
  animation:fdv-grid-spin .7s linear infinite;
}
@keyframes fdv-grid-spin{to{transform:rotate(360deg)}}
.calls-grid-shell{position:relative}
.calls-grid-shell.is-loading .sheet-table-wrap{opacity:.72}

@media (max-width:1000px){
  html,body{max-width:100%;overflow-x:clip}
  .sheet-shell,
  .sheet-shell.rail-collapsed{
    grid-template-columns:58px 0 minmax(0,1fr) !important;
    width:100%;
    min-width:0;
    overflow:hidden;
  }
  .sheet-shell.overviews-collapsed,
  .sheet-shell.rail-collapsed.overviews-collapsed{
    grid-template-columns:58px 36px minmax(0,1fr) !important;
  }
  .nav-rail{grid-column:1}
  .overview-pane{grid-column:2}
  .sheet-main{grid-column:3}
  .sheet-main{width:100%;min-width:0;overflow:hidden}
  .sheet-toolbar.compact-toolbar{
    flex-direction:column;
    align-items:stretch;
    justify-content:flex-start;
    gap:7px;
    padding:8px 9px;
    min-width:0;
  }
  .toolbar-title-block{width:100%;min-width:0}
  .compact-toolbar h1{font-size:18px;line-height:1.2}
  .edit-hint{display:none}
  .grid-row-actions{
    width:100%;
    max-width:100%;
    contain:layout paint;
    flex-wrap:nowrap;
    overflow-x:auto;
    overflow-y:hidden;
    -webkit-overflow-scrolling:touch;
    scrollbar-width:thin;
    padding-bottom:3px;
  }
  .grid-row-actions>*{flex:0 0 auto}
  .sheet-search,.smartsheet-mode .sheet-search{
    display:grid;
    grid-template-columns:minmax(0,1fr) auto;
    gap:6px;
    width:100%;
    min-width:0;
    margin:0;
  }
  .sheet-search input{width:100%;min-width:0}
  .calls-grid-shell{width:100%;min-width:0;overflow:hidden}
  .sheet-table-wrap,.calls-grid-viewport{
    width:100%;
    min-width:0;
    overflow-x:auto;
    overflow-y:auto;
    -webkit-overflow-scrolling:touch;
    overscroll-behavior:contain;
    touch-action:pan-x pan-y;
  }
  .sheet-bottom-scroll,.calls-grid-hscroll{display:none}
  .calls-grid-pagination{
    padding:5px 8px;
    font-size:12px;
    overflow-x:auto;
    white-space:nowrap;
  }
}
@media (max-width:600px){
  .topbar{padding-left:10px;padding-right:10px;gap:8px}
  .brand{min-width:0}
  .brand img{max-width:min(150px,42vw);height:30px}
  .userbar{min-width:0;gap:7px}
  .userbar>span{max-width:92px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .userbar .linkbtn{white-space:nowrap;font-size:0;width:44px;height:44px;padding:0}.userbar .linkbtn::before{content:'↪';font-size:22px}
}

/* Mobile-only navigation and compact All Calls columns. Desktop remains the
   existing three-pane layout above this breakpoint. */
@media (max-width:767px){
  .sheet-shell,.sheet-shell.rail-collapsed,.sheet-shell.overviews-collapsed,.sheet-shell.rail-collapsed.overviews-collapsed{
    grid-template-columns:1fr !important;
    grid-template-rows:auto minmax(0,1fr);
    width:100%;min-width:0;height:calc(100vh - 68px);overflow:hidden;
  }
  .nav-rail{grid-column:1;grid-row:1;display:flex;flex-direction:row;width:100%;min-height:54px;border-right:0;border-bottom:1px solid #202126;}
  .rail-top{display:none;}
  .rail-menu{display:flex;flex:1;flex-wrap:wrap;align-items:stretch;padding:0;}
  .rail-item{flex:1 1 44px;justify-content:center;gap:0;min-width:44px;min-height:48px;padding:2px 3px;font-size:12px;white-space:normal;text-align:center;}
  .rail-item .rail-label{display:none;}
  .rail-icon{width:auto;font-size:22px;line-height:1;}
  .rail-user{margin:0;border:0;border-left:1px solid #383a40;padding:7px 9px;}
  .rail-user .rail-label{display:none;}
  .overview-pane{display:none !important;}
  .sheet-main{grid-column:1;grid-row:2;width:100%;min-width:0;}
  .grid-row-actions{flex-wrap:wrap;overflow:visible;gap:6px;padding-bottom:0;contain:none;}
  .grid-row-actions>*{min-height:42px;}
  #insert-row-button,#delete-row-button,.draft-actions,.row-action-status,.grid-toolbar-separator,
  .grid-row-actions .toolbar-field,[data-open-conditional],[data-open-columns],[data-open-appearance]{display:none !important;}
  .toolbar-menu{position:static;}
  .toolbar-menu>button{min-width:44px;min-height:42px;}
  .toolbar-menu-popover{position:fixed;left:8px;right:8px;top:72px;z-index:1000;min-width:0;max-height:70vh;overflow-y:auto;padding:8px;border-radius:10px;box-shadow:0 12px 32px rgba(0,0,0,.3);}
  .toolbar-menu-popover a,.toolbar-menu-popover button{min-height:44px;padding:11px 12px;font-size:15px;}
  .toolbar-menu-popover a.active{background:#dff1fb;font-weight:700;outline:2px solid #3ba0d6;outline-offset:-2px;}
  .sheet-table-wrap,.calls-grid-viewport{overflow-x:hidden;}
  .exact-smartsheet{width:100%;min-width:0;table-layout:fixed;}
  .exact-smartsheet [data-column]:not([data-column="__select"]):not([data-column="Call Ref"]):not([data-column="Customer"]):not([data-column="Customer Name"]):not([data-column="Telephone No"]){display:none;}
  .exact-smartsheet col.mobile-select-col{width:9%;}
  .exact-smartsheet col.mobile-call-ref{width:25%;}
  .exact-smartsheet col.mobile-customer{width:21%;}
  .exact-smartsheet col.mobile-customer-name{width:21%;}
  .exact-smartsheet col.mobile-telephone{width:24%;}
  .exact-smartsheet [data-mobile-hidden]{display:none !important;}
  .exact-smartsheet .select-col{width:auto;min-width:0;padding:7px 4px;text-align:center;}
  .exact-smartsheet th.col-call-ref,.exact-smartsheet td.col-call-ref,.exact-smartsheet th.col-customer,.exact-smartsheet td.col-customer{position:static;}
  .exact-smartsheet th[data-column="Call Ref"],.exact-smartsheet td[data-column="Call Ref"],.exact-smartsheet [data-column="Call Ref"] .call-link{white-space:nowrap;overflow-wrap:normal;}
  .exact-smartsheet th[data-column="Call Ref"]{font-size:12px;}
  .exact-smartsheet td[data-column="Call Ref"]{font-size:12px;}
  .exact-smartsheet [data-column="Telephone No"]{white-space:nowrap;}
  .exact-smartsheet [data-column="Telephone No"] .phone-link{white-space:nowrap;display:inline-block;}
  .exact-smartsheet th,.exact-smartsheet td{font-size:13px;white-space:normal;overflow-wrap:anywhere;padding:7px 5px;}
  .exact-smartsheet .col-call-ref a{display:block;white-space:nowrap;overflow-wrap:normal;}
  .calls-grid-shell{min-width:0;}
}

.selection-count{font-size:12px;white-space:nowrap}.export-summary{padding:11px 12px;border:1px solid var(--border);border-radius:7px;background:#f7f9f9;font-weight:700}.export-card{width:min(620px,calc(100vw - 24px));max-height:calc(100vh - 24px);overflow:auto}.export-options{margin:0;border:0;padding:0;background:transparent}.export-format{border:1px solid var(--border);border-radius:7px;padding:10px 12px}.export-format legend{padding:0 4px;color:var(--muted);font-size:12px;font-weight:700;text-transform:uppercase}.export-format label{display:block;margin:5px 0}.export-format input{width:auto;padding:0}
.export-columns-fieldset{border:1px solid var(--border);border-radius:7px;padding:10px 12px}.export-columns-fieldset legend{padding:0 4px;color:var(--muted);font-size:12px;font-weight:700;text-transform:uppercase}.export-column-actions{display:flex;flex-wrap:wrap;align-items:center;gap:6px;margin-bottom:8px}.export-column-actions button{padding:6px 9px;font-size:12px}.export-columns-list{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:5px 12px;max-height:240px;overflow:auto}.export-columns-list label{display:flex;align-items:flex-start;gap:6px;min-width:0;font-size:13px}.export-columns-list input{width:auto;flex:0 0 auto;margin-top:3px}.export-columns-empty{display:block;color:var(--danger);font-weight:700;margin-top:7px}
@media(max-width:600px){.export-columns-list{grid-template-columns:1fr;max-height:300px}.export-card{width:calc(100vw - 16px);max-height:calc(100dvh - 16px);padding:14px}.export-column-actions{display:grid;grid-template-columns:1fr 1fr}.export-column-actions button{min-height:42px}.export-column-actions [data-export-columns-count]{grid-column:1/-1}}

/* === v18 ticket photos === */
.photo-panel{margin:0 0 20px;background:#fff;border:1px solid var(--border);border-radius:12px;padding:18px;scroll-margin-top:82px}
.photo-panel-head{display:flex;align-items:flex-start;justify-content:space-between;gap:14px;margin-bottom:14px}
.photo-panel-head h2{margin:0 0 3px;font-size:20px}.photo-panel-head p{margin:0}.photo-count{flex:0 0 auto;background:#eef7f0;color:#34734a;border:1px solid #cfe4d5;border-radius:999px;padding:5px 10px;font-size:12px;font-weight:700}
.photo-gallery{display:grid;grid-template-columns:repeat(auto-fill,minmax(145px,1fr));gap:12px;margin-bottom:16px}
.photo-thumb{display:grid;grid-template-rows:auto auto auto;gap:5px;min-width:0;padding:0 0 9px;background:#fff;border:1px solid var(--border);border-radius:9px;overflow:hidden;text-align:left;color:var(--ink);cursor:pointer}
.photo-thumb:hover,.photo-thumb:focus-visible{border-color:#7fb58e;box-shadow:0 0 0 2px rgba(88,184,117,.18)}
.photo-image-wrap{display:grid;place-items:center;width:100%;aspect-ratio:4/3;background:#eef1f1;overflow:hidden}
.photo-image-wrap img{display:block;width:100%;height:100%;object-fit:cover}
.photo-image-wrap.photo-image-unavailable::before{content:"Image preview unavailable";padding:12px;text-align:center;font-size:12px;color:var(--muted)}
.photo-thumb-name,.photo-thumb-meta{display:block;min-width:0;padding:0 9px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.photo-thumb-name{font-size:12px;font-weight:700}.photo-thumb-meta{font-size:10px;color:var(--muted)}
.photo-empty{padding:18px;border:1px dashed #c9d0cd;border-radius:9px;background:#f8faf9;color:var(--muted);margin-bottom:16px;text-align:center}
.photo-upload-form{display:grid;gap:12px;border-top:1px solid var(--border);padding-top:16px}
.photo-picker{display:grid;place-items:center;gap:3px;min-height:92px;padding:16px;border:2px dashed #b8c7bd;border-radius:10px;background:#f8fbf9;text-align:center;cursor:pointer}
.photo-picker:hover{border-color:var(--green);background:#f3faf5}.photo-picker input{position:absolute;width:1px;height:1px;opacity:0;pointer-events:none}
.photo-picker-title{font-size:17px;font-weight:800;color:#2f7a47}.photo-picker-copy{font-size:12px;color:var(--muted)}
.photo-selection{display:grid;grid-template-columns:repeat(auto-fill,minmax(185px,1fr));gap:8px}
.photo-selected-card{display:grid;grid-template-columns:52px minmax(0,1fr) 30px;gap:8px;align-items:center;border:1px solid var(--border);border-radius:8px;padding:6px;background:#fff}
.photo-selected-card img{width:52px;height:52px;border-radius:6px;object-fit:cover;background:#eef1f1}.photo-selected-text{display:grid;min-width:0}.photo-selected-text strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px}.photo-selected-text span{font-size:11px;color:var(--muted)}
.photo-selected-card .iconbtn{width:28px;height:28px;padding:0;font-size:18px;line-height:1}
.photo-note-field textarea{min-height:72px}.photo-upload-actions{display:flex;justify-content:flex-end;gap:8px}.photo-upload-status{display:grid;gap:5px}
.photo-progress{height:7px;border-radius:999px;background:#e3e8e5;overflow:hidden}.photo-progress span{display:block;height:100%;width:0;background:var(--green);transition:width .12s linear}
.photo-lightbox{width:min(1080px,calc(100vw - 24px));max-width:none;max-height:calc(100vh - 24px);padding:0;border:0;border-radius:10px;background:#111;box-shadow:0 24px 80px rgba(0,0,0,.55)}
.photo-lightbox::backdrop{background:rgba(0,0,0,.78)}.photo-lightbox-card{display:grid;grid-template-rows:auto minmax(0,1fr) auto;max-height:calc(100vh - 24px);color:#fff}
.photo-lightbox-head,.photo-lightbox-actions{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 14px;background:#202124}.photo-lightbox-head .muted,.photo-lightbox-actions .muted{color:#b9c0c4}.photo-lightbox-head .iconbtn{background:#303236;border-color:#555;color:#fff;font-size:23px;line-height:1}
.photo-lightbox-stage{position:relative;display:grid;place-items:center;min-height:240px;overflow:hidden;background:#090909}.photo-lightbox-stage img{display:block;max-width:100%;max-height:calc(100vh - 155px);width:auto;height:auto;object-fit:contain}
.photo-nav{position:absolute;z-index:2;top:50%;translate:0 -50%;width:46px;height:60px;border:0;border-radius:8px;background:rgba(20,20,20,.6);color:#fff;font-size:40px;line-height:1;cursor:pointer}.photo-nav-prev{left:10px}.photo-nav-next{right:10px}.photo-nav:hover{background:rgba(20,20,20,.85)}
.photo-lightbox-actions .secondary{background:#fff;color:#222}
.attachments a{color:#287da9;text-decoration:none}.attachments a:hover{text-decoration:underline}

@media(max-width:700px){
  .photo-panel{padding:13px;margin-left:0;margin-right:0}.photo-panel-head{align-items:center}.photo-panel-head h2{font-size:18px}.photo-gallery{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.photo-thumb-name{font-size:11px}.photo-thumb-meta{display:none}.photo-selection{grid-template-columns:1fr}.photo-upload-actions{display:grid;grid-template-columns:1fr 1fr}.photo-upload-actions button{width:100%}.photo-lightbox{width:100vw;max-height:100dvh;border-radius:0}.photo-lightbox-card{max-height:100dvh;height:100dvh}.photo-lightbox-stage img{max-height:calc(100dvh - 145px)}.photo-nav{width:38px;height:52px;font-size:34px}.photo-nav-prev{left:4px}.photo-nav-next{right:4px}.photo-lightbox-head{padding-top:max(10px,env(safe-area-inset-top))}.photo-lightbox-actions{padding-bottom:max(10px,env(safe-area-inset-bottom))}
}

/* === v18.1 Closing photo selection + upload retry UX === */
.closing-photo-options{margin:0;padding:12px;border:1px solid var(--border);border-radius:7px;background:#fbfcfb}
.closing-photo-options legend{padding:0 6px;font-weight:700}.closing-photo-options>p{margin:0 0 9px}
.closing-photo-list{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:8px;max-height:260px;overflow:auto;padding:2px}
.closing-photo-choice{display:grid;grid-template-columns:20px 56px minmax(0,1fr);gap:8px;align-items:center;padding:7px;border:1px solid var(--border);border-radius:7px;background:#fff;cursor:pointer;min-width:0}
.closing-photo-choice:has(input:checked){border-color:#4e8f62;background:#edf7f0}.closing-photo-choice input{width:auto}.closing-photo-choice img{width:56px;height:44px;object-fit:cover;border-radius:5px;background:#eef1f1}.closing-photo-choice span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px;font-weight:700}
.closing-photo-delivery{display:grid;gap:8px;margin-top:11px;padding-top:10px;border-top:1px solid var(--border)}.closing-photo-delivery label{display:flex;gap:8px;align-items:flex-start;font-size:13px}.closing-photo-delivery input{width:auto;margin-top:2px}
.photo-upload-form [data-photo-upload-message]{overflow-wrap:anywhere}.photo-upload-form button[data-photo-submit]{min-width:118px}
@media(max-width:700px){.closing-photo-list{grid-template-columns:1fr 1fr;max-height:300px}.closing-photo-choice{grid-template-columns:18px 44px minmax(0,1fr);padding:6px}.closing-photo-choice img{width:44px;height:38px}.closing-photo-choice span{font-size:11px}}
