/* Chardins v4.15.17.8.4.8 — calculation layout and controls.
   Load last. Container queries follow the available editor width when the
   navigation drawer opens; they do not change application permissions. */

.ws-shell{container:calc-workspace / inline-size}
.ws-shell .ws-grid{display:grid;grid-template-columns:220px minmax(0,1fr) 312px}
.ws-shell .ws-rail{display:block;grid-column:1}
.ws-shell .ws-main{container:calc-programme / inline-size;min-width:0;grid-column:2}
.ws-shell .ws-quote{container:calc-quote / inline-size;grid-column:3;position:sticky;max-width:none}

/* Context and actions remain readable when the title is long. */
.ws-shell .ws-header{flex-wrap:wrap;align-items:center;gap:16px;padding:18px 20px}
.ws-header .calc-context-main{flex:1 1 420px}
.ws-header .calc-context-main h3{color:#fff;white-space:normal;overflow-wrap:break-word;line-height:1.18;margin:9px 0 10px}
.ws-header.promo .calc-context-main h3{color:var(--gold2,#dfbe79)}
.ws-header .ws-header-kicker{gap:12px;flex-wrap:wrap}
.ws-shell .ws-header .calc-back{
  min-height:34px;padding:7px 11px;margin:0;border:1px solid rgba(255,255,255,.26);
  border-radius:9px;color:#edf2f6;font-size:11px;font-weight:700;line-height:1.2;
}
.ws-shell .ws-header .calc-back:hover{border-color:#d4b574;background:rgba(255,255,255,.08)!important}
.ws-shell .ws-head-actions{max-width:100%;flex:0 1 auto;flex-wrap:wrap;overflow:visible;gap:7px;justify-content:flex-end}
.ws-shell .ws-head-actions>.btn,.ws-shell .ws-head-menu>summary{min-height:40px;padding:10px 12px;font-size:11px;border-radius:10px}
.ws-shell .ws-head-actions .ws-readiness-chip.ok{background:#d5b271;border-color:#d5b271;color:#0b2233}
.ws-shell .ws-head-actions .ws-readiness-chip.ok:hover{background:#e0c18b;border-color:#e0c18b}
.ws-shell .ws-head-actions .ws-readiness-chip.danger{background:#492b39;border-color:#805162;color:#f5d3d6}
.ws-shell .ws-head-actions .ws-readiness-chip:disabled{opacity:.75;cursor:not-allowed}
.ws-shell .ws-worknav{top:calc(var(--cv-masthead-h,76px) + 8px);flex-wrap:wrap;overflow:visible;gap:4px 10px;padding-block:4px}
.ws-shell .ws-worknav-main{min-height:42px;flex-wrap:wrap;gap:6px 8px}
.ws-shell .ws-tabs-main{min-height:38px}
.ws-shell .ws-worknav-tools{flex-wrap:wrap;overflow:visible}
.ws-shell .ws-tabs-meta{padding:6px 0}
.ws-shell .ws-rail,.ws-shell .ws-quote{top:calc(var(--cv-masthead-h,76px) + 76px);max-height:calc(100dvh - var(--cv-masthead-h,76px) - 92px);scrollbar-width:thin}

/* Day title and cost chips own the full width; actions use a separate row. */
.ws-shell .calc-day-head{
  display:grid;grid-template-columns:24px 46px minmax(0,1fr);
  align-items:start;gap:10px 12px;padding:18px;background:#fff;
}
.ws-shell .calc-day-head>.calc-day-handle{grid-column:1;grid-row:1;align-self:start;margin-top:4px}
.ws-shell .calc-day-head>.calc-day-num{grid-column:2;grid-row:1;width:44px;height:44px;margin-top:3px}
.ws-shell .calc-day-head>.calc-day-copy{grid-column:3;grid-row:1;min-width:0}
.ws-shell .calc-day-copy h4{font-size:23px;line-height:1.2;margin:4px 0 5px;overflow-wrap:break-word}
.ws-shell .calc-day-copy p{font-size:12px;line-height:1.5;overflow-wrap:break-word}
.ws-shell .calc-day-chips{gap:6px;margin-top:10px}
.ws-shell .calc-day-chips .calc-ui-cost-chip{font-size:10px;letter-spacing:.035em;white-space:normal;line-height:1.4;min-height:26px}
.ws-shell .calc-day-head>.calc-day-actions{
  grid-column:1 / -1;grid-row:2;display:flex;flex-wrap:wrap;justify-content:flex-end;
  overflow:visible;gap:7px;padding-top:13px;margin-top:2px;border-top:1px solid var(--ws-hair,#ebe4d8);
}
.ws-shell .calc-day-actions .btn{min-height:36px;padding:8px 12px;font-size:11px;white-space:normal}
.ws-shell .calc-day-actions>.icon-button{width:36px;height:36px;border:1px solid #ccd6dd;background:#fff;color:#19364c}
.ws-shell .calc-day-ops{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));overflow:visible}
.ws-shell .calc-day-ops>button{min-width:0;padding:12px;border-bottom:0!important}
.ws-shell .calc-day-ops b,.ws-shell .calc-day-ops small{white-space:normal;overflow-wrap:break-word;line-height:1.45}

/* The fast table reserves real space for both controls, including with the
   sidebar open. Narrow centre columns become complete, legible day cards. */
.ws-shell .ws-legend,.ws-shell .ws-row{
  grid-template-columns:10px 36px 118px minmax(140px,1.4fr) 60px minmax(110px,1fr) minmax(110px,1fr) 72px;
  gap:8px;padding-left:14px;padding-right:14px;
}
.ws-shell .ws-row>span{min-width:0}
.ws-shell .ws-row-actions{opacity:1;gap:6px;min-width:72px;justify-content:flex-end}
.ws-shell .ws-row-actions .icon-button{flex:0 0 33px;width:33px;height:33px;border:1px solid #d8dfe4;background:#fff;color:#324c60}
.ws-shell .ws-row-actions .icon-button.danger{border-color:#ead5d2;color:#a44b44;background:#fffafa}
.ws-shell .ws-row-actions .icon-button:hover{border-color:#b38a48;box-shadow:0 2px 6px rgba(11,31,51,.08)}
.ws-shell .ws-date input{padding:8px 5px;font-size:12px;min-width:0}
.ws-shell .ws-row .ws-night{min-width:0}
.ws-shell .ws-night strong{white-space:normal;line-height:1.4;overflow-wrap:break-word}
.ws-shell .ws-night .calc-ui-fast-hotel-price{white-space:normal;line-height:1.4}

/* A number input inherited a narrow width, large padding and a native
   stepper. Give the margin an explicit, usable numeric field. */
.ws-shell .ws-metrics{grid-template-columns:minmax(0,1fr) minmax(84px,.95fr) minmax(0,1fr);gap:7px;align-items:stretch}
.ws-shell .ws-metrics>div{min-width:0;padding:9px 7px}
.ws-shell .ws-metrics>div>span{font-size:10px;letter-spacing:.06em}
.ws-shell .ws-metrics b{font-size:18px;font-variant-numeric:tabular-nums;line-height:1.4;overflow-wrap:anywhere}
.ws-shell label.ws-quote-margin{display:flex;align-items:center;gap:3px;min-width:0;margin:5px 0 0;font:400 18px/1.3 Georgia,serif;letter-spacing:0}
.ws-shell .ws-quote-margin input{
  display:block;flex:1 1 52px;width:52px;min-width:52px;max-width:100%;height:34px;min-height:34px;
  padding:5px 2px;border:1px solid #d0d9df;border-radius:6px;background:#fff;
  font:400 17px/1.3 Georgia,serif;font-variant-numeric:tabular-nums;text-align:center;appearance:textfield;
}
.ws-shell .ws-quote-margin input::-webkit-inner-spin-button,.ws-shell .ws-quote-margin input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}
.ws-shell .ws-quote-margin input:focus{border-width:1px;padding:5px 2px}
.ws-shell .ws-quote-margin i{flex:0 0 auto;font-size:13px}
.ws-shell .ws-quote-pax{flex-wrap:wrap}
.ws-shell .ws-quote-pax>div{flex-wrap:wrap}
.ws-shell .ws-quote-pax button{min-width:34px;padding:7px 8px}

/* The day modal's collapsed costing section is an actual full-width
   control. Keep AI text actions compact and near their field labels. */
.ws-modal .calc-day-costing-toggle{width:100%;border:1px solid #c7d2db;border-radius:11px;background:#f1f5f7;overflow:hidden}
.ws-modal .calc-day-costing-toggle>summary{display:flex;align-items:center;justify-content:space-between;width:100%;min-height:52px;padding:15px 18px;background:#eef3f6;color:#15354c;font-size:13px;font-weight:750;cursor:pointer}
.ws-modal .calc-day-costing-toggle>summary:hover{background:#e5edf2}
.ws-modal .calc-day-costing-toggle[open]>summary{border-bottom:1px solid #c7d2db}
.ws-modal .calc-day-ai-tools{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:6px}
.ws-modal .calc-day-ai-tools label{margin:0}
.ws-modal .calc-day-ai-tools .btn{min-height:30px;padding:5px 10px;font-size:11px;white-space:nowrap}

@container calc-workspace (max-width:1250px){
  .ws-shell .ws-grid{grid-template-columns:minmax(0,1fr) 300px;gap:12px}
  .ws-shell .ws-rail{display:grid;grid-template-columns:auto minmax(0,1fr);gap:9px;grid-column:1 / -1;position:static;max-height:none;min-width:0;padding:11px 12px}
  .ws-shell .ws-rail-head{grid-column:1;grid-row:1;margin:0}
  .ws-shell .ws-rail-head>div{flex-wrap:wrap}
  .ws-shell .ws-day-list{grid-column:1 / -1;grid-row:2;display:flex;gap:8px;min-width:0;overflow-x:auto;padding:2px 2px 6px;scrollbar-width:thin;scroll-snap-type:x proximity}
  .ws-shell .ws-day{flex:0 0 214px;width:214px;scroll-snap-align:start}
  .ws-shell .ws-day-copy strong{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;line-height:1.35}
  .ws-shell .ws-rail-actions{grid-column:2;grid-row:1;display:flex;justify-content:flex-end;gap:6px;flex-wrap:wrap;border:0;margin:0;padding:0}
  .ws-shell .ws-rail-actions .btn{min-height:30px;padding:6px 8px;font-size:10px}
  .ws-shell .ws-main{grid-column:1}
  .ws-shell .ws-quote{grid-column:2;max-width:none}
  .ws-tabs-meta{display:none}
}
@container calc-workspace (max-width:850px){
  .ws-shell .ws-grid{display:block}
  .ws-shell .ws-rail{margin-bottom:12px}
  .ws-shell .ws-quote{position:static;max-height:none;width:100%;max-width:none;margin-top:14px}
  .ws-head-actions{width:100%;justify-content:flex-start!important}
}
@container calc-workspace (max-width:540px){
  .ws-shell .ws-rail{grid-template-columns:minmax(0,1fr)}
  .ws-shell .ws-rail-actions{grid-column:1;grid-row:3;justify-content:flex-start}
  .ws-shell .ws-day{flex-basis:196px;width:196px}
}
@container calc-programme (max-width:899px){
  .ws-shell .ws-legend{display:none}
  .ws-shell .ws-row{display:grid;grid-template-columns:10px 36px minmax(125px,1fr) minmax(80px,1fr) 72px;gap:10px;padding:15px}
  .ws-shell .ws-row>.ws-dot{grid-column:1;grid-row:1;margin-top:0}
  .ws-shell .ws-row>.ws-no{grid-column:2;grid-row:1}
  .ws-shell .ws-row>.ws-date{grid-column:3;grid-row:1;max-width:158px}
  .ws-shell .ws-row>.ws-meta{grid-column:4;grid-row:1;text-align:right}
  .ws-shell .ws-row>.ws-row-actions{grid-column:5;grid-row:1}
  .ws-shell .ws-row>.ws-route{grid-column:1 / -1;grid-row:2}
  .ws-shell .ws-row>[id^="wsNightPremium"]{grid-column:1 / 4;grid-row:3;min-width:0}
  .ws-shell .ws-row>[id^="wsNightStandard"]{grid-column:4 / -1;grid-row:3;min-width:0}
  .ws-shell .ws-night{height:100%}
  .ws-shell .calc-day-ops{grid-template-columns:repeat(2,minmax(0,1fr))}
  .ws-shell .calc-day-ops>button:nth-child(2){border-right:0!important}
  .ws-shell .calc-day-ops>button:nth-child(-n+2){border-bottom:1px solid #eee9df!important}
}
@container calc-programme (max-width:520px){
  .ws-shell .ws-row{grid-template-columns:10px 32px minmax(0,1fr) 72px;gap:8px;padding:12px}
  .ws-shell .ws-row>.ws-date{grid-column:3;max-width:none}
  .ws-shell .ws-row>.ws-row-actions{grid-column:4}
  .ws-shell .ws-row>.ws-route{grid-row:2}
  .ws-shell .ws-row>.ws-meta{grid-column:1 / -1;grid-row:3;text-align:left;display:flex;gap:7px}
  .ws-shell .ws-row>[id^="wsNightPremium"]{grid-column:1 / -1;grid-row:4}
  .ws-shell .ws-row>[id^="wsNightStandard"]{grid-column:1 / -1;grid-row:5}
  .ws-shell .calc-day-head{grid-template-columns:22px 36px minmax(0,1fr);gap:8px;padding:13px}
  .ws-shell .calc-day-head>.calc-day-num{width:34px;height:34px}
  .ws-shell .calc-day-copy h4{font-size:20px}
  .ws-shell .calc-day-head>.calc-day-actions{justify-content:flex-start}
  .ws-shell .ws-modes{flex-wrap:wrap;overflow:visible;padding:8px}
  .ws-shell .ws-mode-actions{width:100%;margin-left:0;flex-wrap:wrap}
  .ws-shell .ws-mode-actions>.btn{flex:1 1 auto}
  .ws-shell .ws-totals{gap:14px}
}
@container calc-quote (min-width:540px){
  .ws-quote-card{display:grid;grid-template-columns:1fr 1fr}
  .ws-quote-tiers,.ws-quote-pax{grid-column:1 / -1}
  .ws-quote-hero{align-content:center}
  .ws-quote-body{grid-column:2}
}
@media(max-width:760px){
  .ws-shell .ws-header{padding:15px;gap:13px}
  .ws-header .calc-context-main{flex-basis:auto;width:100%}
  .ws-shell .ws-head-actions{justify-content:flex-start}
  .ws-shell .ws-worknav-main{overflow:visible}
  .ws-shell .ws-worknav-tools{width:100%}
  .ws-shell .ws-worknav-tools button{min-height:34px;padding:6px 9px;font-size:11px}
  .ws-shell .ws-tabs-main{width:100%}
  .ws-shell .ws-tabs-main button{flex:1;min-height:40px;font-size:11px}
  .ws-shell .ws-routing-action{display:inline-block;min-height:34px}
  .ws-modal .calc-day-ai-tools{flex-wrap:wrap}
}
