:root {
  --crm-font: "Segoe UI", Arial, sans-serif;
  --crm-page: #eaf3fb;
  --crm-surface: #fff;
  --crm-ink: #172e49;
  --crm-muted: #49627b;
  --crm-header: #112d4e;
  --crm-border: #ccdeec;
  --crm-primary: #185bad;
  --crm-primary-hover: #124780;
  --crm-secondary: #e4eff9;
  --crm-selected: #deedfc;
  --crm-danger: #9f3434;
  --crm-radius: 8px;
  --crm-control-height: 36px;
}
@media (pointer: coarse) { :root { --crm-control-height: 44px; } }
[data-resort-theme="arkhyz"] {
  --resort-mark:url('/static/resort-brands/arkhyz-mark.svg');
  --crm-header:#10285c; --crm-primary:#1243b8; --crm-primary-hover:#0d338d;
  --nav-tab:#183975; --nav-tab-border:#607ca8; --nav-tab-hover:#224997;
  --pass-gradient:linear-gradient(145deg,#0032c8,#10285c);
  --resort-header-art:radial-gradient(ellipse at top left,#193e87,transparent 66%);
}
[data-resort-theme="polyana"] {
  --resort-mark:url('/static/resort-brands/polyana-mark.svg');
  --crm-page:#fbf5f2; --crm-header:#63251f; --crm-primary:#b03223; --crm-primary-hover:#8a281d;
  --crm-secondary:#f5e8e2; --crm-selected:#fbe0d7; --crm-border:#e3cdc4;
  --crm-muted:#735952; --crm-ink:#392721;
  --nav-tab:#78362c; --nav-tab-border:#b47868; --nav-tab-hover:#904338;
  --pass-gradient:linear-gradient(145deg,#b63222,#63251f);
  --summit-base:#63251f; --summit-slope:#a34536; --summit-snow:#fae0d5;
  --resort-header-art:linear-gradient(118deg,#943628,transparent 65%);
}
:root{font-family:Inter,system-ui,-apple-system,"Segoe UI",sans-serif;color:#172b3d;background:var(--crm-page);font-synthesis:none}*{box-sizing:border-box}body{margin:0;min-height:100vh}.top{background:#172b3d;color:#fff;padding:18px max(18px,calc((100vw - 1040px)/2));display:flex;align-items:center;gap:12px}.top strong{font-size:19px}.top small{margin-left:auto;color:#d7e0e8}.wrap{max-width:1040px;margin:24px auto;padding:0 16px 48px}.panel{background:#fff;border:1px solid #e1e7ec;border-radius:16px;padding:20px;margin:0 0 16px;box-shadow:0 3px 14px #172b3d08}.hidden{display:none!important}h1{font-size:25px;margin:0 0 7px}h2{font-size:18px;margin:0 0 14px}p{line-height:1.5;color:#5b6b79}.grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.field{display:flex;flex-direction:column;gap:6px;margin-bottom:12px}label{font-weight:650;font-size:14px}input,select,textarea{width:100%;font:inherit;padding:12px 13px;border:1px solid #cbd5dd;border-radius:10px;background:#fff;color:#172b3d;min-height:44px}input:focus,select:focus,textarea:focus{outline:3px solid #b9d8ef;border-color:#4385b2}button{font:inherit;font-weight:650;border:0;border-radius:10px;padding:12px 16px;background:#176b9b;color:#fff;cursor:pointer;min-height:44px}button.secondary{background:#e9eff3;color:#172b3d}button.danger{background:#9f3434}button:disabled{opacity:.5;cursor:not-allowed}.row{display:flex;align-items:center;gap:10px;flex-wrap:wrap}.row>*{flex:1}.row .fit{flex:0 0 auto}.line{border:1px solid #e1e7ec;border-radius:12px;padding:12px;margin:10px 0}.muted{color:#647482;font-size:13px}.status{padding:9px 12px;border-radius:10px;background:#edf3f6;color:#29475b;font-size:14px;margin:12px 0}.status.good{background:#eaf6ef;color:#21613a}.status.warn{background:#fff4df;color:#805300}.status.bad{background:#faeaea;color:#8a2424}.pill{border-radius:999px;padding:5px 10px;background:#e9eff3;font-size:12px;font-weight:700}.total{font-size:20px;font-weight:750}.queue-item{display:flex;gap:10px;align-items:center;justify-content:space-between;padding:10px 0;border-bottom:1px solid #edf0f2}.queue-item:last-child{border:0}.small{font-size:12px;color:#647482}.link{color:#176b9b}.notice{background:#fff8e9;border:1px solid #f0dfb5;padding:12px;border-radius:10px;color:#71551c;font-size:13px}@media(max-width:650px){.wrap{margin:14px auto}.panel{padding:16px}.grid{grid-template-columns:1fr}.top{padding:15px 16px}.top small{font-size:11px}}
.pay-heading{display:flex;justify-content:space-between;gap:20px;align-items:start;margin-bottom:20px}.pay-heading p{margin:6px 0}.pay-heading details{min-width:160px}.pay-heading summary,#operator-goal>summary{cursor:pointer;min-height:var(--crm-control-height);padding:8px 0;color:var(--crm-primary);font-weight:650}.pay-goal-card{padding:22px;background:var(--crm-page);border:1px solid var(--crm-border);border-radius:10px;margin:0 0 24px}.pay-goal-card h2{margin:0}.pay-goal-card p{margin:8px 0}.pay-goal-numbers{display:flex;justify-content:space-between;align-items:center;gap:18px;margin-top:18px}.pay-goal-numbers strong{font-size:30px;color:var(--crm-primary-hover)}.pay-goal-numbers span{font-weight:700;color:var(--crm-primary)}.pay-goal-card progress{width:100%;height:18px;accent-color:var(--crm-primary);margin:10px 0 0}.pay-goal-remaining{font-weight:650;color:var(--crm-muted)}#operator-goal-form{margin-top:12px}.pay-controls{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;align-items:end;margin:14px 0}.pay-controls label{display:grid;gap:6px;min-width:0}.pay-controls input,.pay-controls select{min-width:0;max-width:100%}.pay-controls button{justify-self:start;align-self:end}.pay-section-title{margin:28px 0 8px}.pay-table-wrap{overflow-x:auto;border:1px solid #e0e3eb;border-radius:8px;margin:12px 0}.pay-table{width:100%;border-collapse:collapse;font-size:14px;font-variant-numeric:tabular-nums}.pay-table th{background:#f2f3f8;text-align:left;color:#5b6270;font-weight:650}.pay-table th,.pay-table td{padding:14px 16px;border-bottom:1px solid #e7e9ef;vertical-align:middle}.pay-table tr:last-child td{border-bottom:0}.pay-table .pay-amount{text-align:right;white-space:nowrap}.pay-place{width:80px;font-weight:750;color:var(--crm-primary)}.pay-total{font-weight:750;color:var(--crm-ink)}.pay-incomplete{display:block;color:#805300;margin:5px 0 0}.pay-accrual-total{font-size:20px;color:var(--crm-ink);font-weight:700}body:has(#app-panel) button.pay-person-link{background:transparent;color:var(--crm-primary);padding:0;text-align:left;text-decoration:underline;font-size:14px;font-weight:650}.pay-table tbody tr:hover{background:#faf9ff}@media(max-width:650px){.pay-heading{display:block}.pay-heading details{margin-top:12px}.pay-goal-card{padding:16px}.pay-goal-numbers strong{font-size:25px}.pay-controls{grid-template-columns:repeat(2,minmax(0,1fr))}.pay-table th,.pay-table td{padding:12px;min-width:80px}.pay-table{font-size:13px}}

.panel-inner{padding:14px;background:#f8fafb}.pre{white-space:pre-wrap;overflow-wrap:anywhere}

.top-link{color:#e6f2fa;text-decoration:underline;font-size:13px;margin-left:8px}.payment-box{background:#f7fafc;border:1px solid #e1e7ec;border-radius:10px;padding:12px;margin-top:10px}.payment-box input,.payment-box select{max-width:100%}.cash-shift{background:#f2f7fa;border:1px solid #dae5ec;border-radius:10px;padding:12px;margin:10px 0}

/* Рабочее место менеджера: привычные таблицы и компактные формы. */
body.crm-theme{background:var(--crm-page);color:var(--crm-ink);font-family:var(--crm-font);font-size:14px}
body.crm-theme .top{background:var(--crm-header);padding:18px 24px;min-height:66px}
body.crm-theme:not(.client-portal) .wrap{max-width:1120px;margin:18px auto;padding:0 22px 40px}
body.crm-theme .wrap:has(> #app-panel:not(.hidden) > #control-panel:not(.screen-hidden)) { max-width:none; }
body.crm-theme .panel{border-radius:14px;box-shadow:none;padding:20px;border-color:var(--crm-border)}
:where(body.crm-theme) input:not([type=checkbox],[type=radio],[type=hidden]),:where(body.crm-theme) select,:where(body.crm-theme) textarea{border-radius:var(--crm-radius);min-height:var(--crm-control-height);padding:8px 10px}
:where(body.crm-theme) button{border-radius:var(--crm-radius);min-height:var(--crm-control-height);padding:8px 15px;background:var(--crm-primary);font-size:13px}
body.crm-theme button.secondary{background:var(--crm-secondary);color:var(--crm-ink)}
body.crm-theme #login-panel{max-width:480px;margin:8vh auto}
.screen-hidden{display:none!important}
#workspace-nav{margin-bottom:18px;padding:10px;background:var(--crm-secondary);border-radius:3px}
#workspace-nav button{flex:0 0 auto}#workspace-nav button.active{background:var(--crm-primary)}
#resort-cards{grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:18px;margin-top:24px}
#resort-cards .resort-card{min-height:130px;text-align:left;font-size:23px;background:#fff;color:var(--crm-ink);border:1px solid var(--crm-border);border-top:4px solid var(--crm-primary)}
#resort-cards .resort-card[data-resort-theme="arkhyz"] {
  --card-art:radial-gradient(circle at 66% 23%,#fff9 1px,transparent 2px),
    radial-gradient(circle at 89% 58%,#fff7 1px,transparent 2px),linear-gradient(120deg,#10285c,#0032c8);
}
#resort-cards .resort-card[data-resort-theme="polyana"] {
  --card-art:linear-gradient(132deg,transparent 70%,#ffffff10 70% 73%,transparent 73% 77%,#ffffff0b 77%),
    linear-gradient(115deg,#97291f,#e63621);
}
#resort-cards .resort-card:is([data-resort-theme="arkhyz"],[data-resort-theme="polyana"]) {
  position:relative;isolation:isolate;overflow:hidden;padding:24px;
  background:var(--card-art);color:white;border:0;border-radius:16px;
}
#resort-cards .resort-card[data-resort-theme]::after {
  content:"";position:absolute;z-index:-1;right:-26px;bottom:-26px;width:150px;height:105px;
  background:white;opacity:.12;mask:var(--resort-mark) center / contain no-repeat;pointer-events:none;
}
#resort-cards .resort-card img {display:none;width:145px;max-width:85%;height:48px;object-fit:contain;object-position:left center}
#resort-cards .resort-card.is-branded img {display:block}
#resort-cards .resort-card.is-branded .resort-card-name {
  position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;
}
.order-filters{grid-template-columns:2fr 1fr 1fr;margin-top:20px;max-width:800px}
#control-orders{overflow-x:auto}.orders-table{width:100%;border-collapse:collapse;font-size:13px}
.orders-table th{background:var(--crm-secondary);text-align:left;font-weight:600;color:var(--crm-muted)}
.orders-table th,.orders-table td{padding:12px;border-bottom:1px solid var(--crm-border);vertical-align:top}
.orders-table tbody tr:hover{background:#fafaff}.orders-table .line{background:white}
#staff-form fieldset{border:1px solid var(--crm-border);margin:12px 0;padding:16px;display:flex;gap:20px;flex-wrap:wrap}
#staff-form fieldset input{width:auto;min-height:auto}
@media(max-width:700px){body.crm-theme .wrap{padding:0 10px}.order-filters{grid-template-columns:1fr}#workspace-nav{gap:6px}.orders-table{min-width:750px}}

.service-choices{display:grid;grid-template-columns:repeat(3,minmax(140px,1fr));gap:10px;margin:12px 0 20px}
body:has(#app-panel) .service-choice{display:flex;flex-direction:column;align-items:flex-start;gap:8px;background:#fff;color:var(--crm-ink);border:1px solid var(--crm-border);padding:14px;text-align:left;min-height:80px}
body:has(#app-panel) .service-choice:hover{border-color:var(--crm-primary);background:var(--crm-page)}.service-choice span{color:var(--crm-primary);font-weight:700}
.sale-services{max-width:760px}.cart-line{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 0;border-bottom:1px solid #e2e3eb}.sale-total{font-size:21px;font-weight:700;color:var(--crm-ink);margin-bottom:0}
.compact-form{max-width:560px;margin-top:24px;display:grid;gap:10px}.compact-form input[type=checkbox]{width:auto;min-height:0}
#location-cards{grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:16px;margin:22px 0}
#location-cards .resort-card{min-height:110px;font-size:20px;text-align:left;background:#fff;color:var(--crm-ink);border:1px solid var(--crm-border);border-top:4px solid var(--crm-primary)}
@media(max-width:650px){.service-choices{grid-template-columns:repeat(2,minmax(0,1fr))}.cart-line{align-items:flex-start}}

.drawer-backdrop{position:fixed;inset:0;background:#20233270;z-index:100}
body:has(#app-panel) .sale-drawer{position:fixed;right:0;top:0;height:100dvh;width:min(780px,92vw);overflow-y:auto;z-index:101;margin:0;padding:26px 24px 32px;border-radius:0;box-shadow:-12px 0 40px #14172a30}
.sale-drawer-open{overflow:hidden}.drawer-close{position:sticky;top:0;float:right;z-index:2;margin-left:12px}
.sale-drawer-open #status{position:fixed;z-index:102;left:16px;bottom:12px;max-width:min(480px,calc(100vw - 32px));box-shadow:0 4px 20px #0002}
@media(max-width:650px){body:has(#app-panel) .sale-drawer{width:100vw;padding:18px 14px}}
.editor-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; align-items: start; }
.editor-card { padding: 12px; border: 1px solid #dfe3eb; border-radius: 10px; background: #fff; min-width: 0; box-shadow: 0 2px 8px #172b3d0c; }
.editor-card h3 { margin: 0 0 .25rem; }
.editor-id { overflow-wrap: anywhere; margin-bottom: .65rem; font-size: .8rem; }
.editor-stage { display: inline-block; padding: .2rem .5rem; border-radius: .4rem; background: var(--crm-selected); color: var(--crm-primary-hover); font-size: .875rem; }
.editor-stage-working { background: #fff2ce; color: #664707; }
.editor-stage-waiting { background: #e6f1ff; color: #214e80; }
.editor-stage-quality_check { background: var(--crm-selected); color: var(--crm-primary-hover); }
.editor-stage-preparation, .editor-stage-new { background: #edf0f5; color: #405168; }
.editor-stage-rework { background: #ffe7de; color: #822f15; }
.editor-stage-finished, .editor-stage-delivered { background: #e0f4e9; color: #195533; }
.editor-card details, .editor-card > a { display: block; margin-top: .75rem; }
.editor-card summary { cursor: pointer; }
.editor-card form { margin-top: .65rem; }
.editor-card form input { margin: .35rem 0 .5rem; }
.production-card-group{margin:18px 0 24px}.production-card-group h3{display:flex;align-items:center;gap:8px;margin:0 0 10px;font-size:16px}.production-card-group h3 .pill{font-size:11px;background:var(--crm-page);color:var(--crm-muted)}.production-empty{padding:14px;border:1px dashed #cdd3dd;border-radius:10px;color:#647482;background:#fafbfc}.production-scope{margin:0 0 10px;padding:9px 12px;border-radius:8px;background:var(--crm-page);color:var(--crm-muted);font-weight:650}.production-compact{font-size:13px;line-height:1.35}.production-compact .production-detail{margin-top:10px;border-top:1px solid #e8ebf0;padding-top:8px}.production-compact summary{cursor:pointer;color:var(--crm-muted);font-weight:650;padding:5px 0}.production-compact .line{padding:10px;margin:8px 0}.production-compact .field{margin:8px 0}.production-compact .row{gap:6px}.production-compact button{font-size:12px;padding:8px 10px;min-height:34px}.production-queue-card{position:relative;padding-right:42px}.production-folder-link{position:absolute;top:10px;right:12px;text-decoration:none;font-size:20px;line-height:1}.production-quick-actions{display:flex;flex-wrap:wrap;gap:6px;margin:9px 0 2px}.production-quick-actions button{font-size:12px;padding:7px 9px;min-height:32px}.production-chat{margin-top:12px;padding-top:10px;border-top:1px solid #e8ebf0}.production-chat h4{margin:0 0 8px;color:var(--crm-muted)}.production-chat-topic{font-size:11px;font-weight:700;color:#647482;margin:8px 0 5px}.production-chat-message{max-width:92%;padding:7px 9px;margin:5px 0;border-radius:10px;background:#f1f3f7;font-size:12px}.production-chat-message.self{margin-left:auto;background:#e8f3ff}.production-chat-message strong{display:block;font-size:11px;color:var(--crm-muted)}.production-chat-message p{margin:3px 0;white-space:pre-wrap}.production-chat-message time{display:block;color:#7c8792;font-size:10px;text-align:right}
.editor-answers dt { font-weight: 600; }
.editor-answers dd { margin: .15rem 0 .5rem; overflow-wrap: anywhere; white-space: pre-wrap; }


#items .panel > a.link { display: block; width: fit-content; margin: 12px 0; padding: 6px 0; }

.section-title-row{display:flex;align-items:center;justify-content:space-between;gap:16px;position:relative;margin-bottom:8px}
.section-title-row h1{margin:0}
.compact-create{flex:0 0 auto;position:relative}
.compact-create>summary{display:flex;align-items:center;justify-content:center;width:36px;height:36px;border-radius:50%;background:var(--crm-page);color:var(--crm-muted);font-size:24px;line-height:1;cursor:pointer;list-style:none}
.compact-create>summary::-webkit-details-marker{display:none}
.compact-create>summary:hover{background:var(--crm-selected)}
.compact-create>summary:focus-visible{outline:3px solid #b9d8ef;outline-offset:2px}
.compact-create[open]>summary{background:var(--crm-selected)}
.compact-create>form.compact-form{position:absolute;right:0;top:44px;z-index:20;width:min(340px,calc(100vw - 64px));margin:0;padding:18px;background:#fff;border:1px solid #e1e7ec;border-radius:12px;box-shadow:0 8px 28px #172b3d24}

.staff-location-options{display:flex;flex-wrap:wrap;gap:10px;margin:8px 0 12px}
.staff-location-choice{display:flex;align-items:center;gap:8px;padding:9px 12px;border:1px solid #d9dce7;border-radius:8px;cursor:pointer}
.staff-location-choice input{width:18px;min-height:18px;margin:0}
.staff-person-card{padding:16px;border:1px solid #e1e7ec;border-radius:10px;margin:12px 0}
.staff-person-card>button{margin:10px 8px 0 0}
.staff-assignment-row{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin:10px 0}
.staff-assignment-editor{padding:14px;background:#f6f7fa;border-radius:8px;margin:10px 0}
.staff-assignment-editor button{margin-right:8px}
.staff-password{display:block;overflow-wrap:anywhere;font-family:monospace;margin:10px 0;user-select:all}

.preview-device-switch{display:flex;gap:8px;margin:12px 0}.preview-device-switch button{width:auto}
.role-preview-stage{background:#eceef3;padding:20px;border-radius:12px;margin:16px 0 24px;overflow:auto}
.role-preview-frame{background:#f5f6f8;border:1px solid #ccd1dc;border-radius:12px;overflow:hidden;margin:0 auto;width:100%;min-height:350px;transition:width .15s}
.role-preview-frame[data-device="phone"]{width:390px;max-width:100%;border:7px solid #30343f;border-radius:28px}
.role-preview-top{padding:14px;background:#2b2f36;color:#fff;font-weight:650;overflow-wrap:anywhere}
.role-preview-note{padding:0 14px;font-size:12px}.role-preview-nav{display:flex;flex-wrap:wrap;gap:6px;padding:0 14px 12px}.role-preview-nav button{font-size:13px;padding:8px 12px;min-height:var(--crm-control-height)}
.role-preview-body{background:#fff;padding:18px;margin:0 14px 18px;border-radius:8px}.role-preview-body h2{font-size:20px}.role-preview-body input{margin:6px 0 12px;background:#f9fafb}.role-preview-body>button{margin-top:12px}
.role-preview-frame[data-device="phone"] .grid{grid-template-columns:1fr}.role-preview-frame[data-device="phone"] .role-preview-top{font-size:14px}.role-preview-frame[data-device="phone"] .role-preview-body{padding:14px;margin:0 9px 14px}.role-preview-frame[data-device="phone"] .role-preview-body>button{width:100%}
.permission-card{padding:12px;border:1px solid #e1e7ec;border-radius:8px}.permission-card p{margin-bottom:0}
@media(max-width:600px){.role-preview-stage{padding:10px}.preview-device-switch button{flex:1}}

:host(.production-preview){display:block;color:#172b3d;font:14px var(--crm-font)}:host([data-device=phone]) .grid,:host([data-device=phone]) .editor-cards{grid-template-columns:1fr}:host([data-device=phone]) .panel{padding:14px}:host(.production-preview) input,:host(.production-preview) select{min-width:0;max-width:100%}
#overview-summary .orders-table{min-width:0;margin-bottom:16px;font-size:15px}
#overview-summary tbody tr:first-child>*{font-weight:750;background:#eaf2f6}
#overview-summary td{text-align:right;font-variant-numeric:tabular-nums}
#overview-summary thead th:not(:first-child){text-align:right}
@media(max-width:520px){#overview-summary .orders-table th,#overview-summary .orders-table td{padding:9px 5px}}
#location-cards .location-totals{display:block;margin-top:8px;font-size:14px;font-weight:500;line-height:1.5;color:#515768}
.top .brand-home { color: inherit; }
body.crm-theme:is([data-resort-theme="arkhyz"],[data-resort-theme="polyana"]) .top {
  background-color:var(--crm-header);background-image:var(--resort-header-art);
}
body:is([data-resort-theme="arkhyz"],[data-resort-theme="polyana"]) .top .brand-home::before {
  content:"";display:inline-block;width:1.4em;height:1.2em;margin-right:.4em;vertical-align:-.22em;
  background:var(--resort-mark) center / contain no-repeat;
}
.client-portal .customer-brand {display:inline-flex;align-items:center;gap:12px}
.client-portal .customer-brand img {height:26px;width:auto;max-width:112px}
.client-portal .customer-brand img[hidden] {display:none}
.top .brand-home, .top .brand-home:hover { text-decoration: none; }
@media (hover: hover) {
  .top .brand-home:hover { color: #c5e7ff; }
}
@media (hover: hover) and (prefers-reduced-motion: no-preference) and (forced-colors: none) {
  @supports (background-clip: text) {
    .top .brand-home:hover {
      background-image: linear-gradient(110deg, #fff 35%, #86cbff 43%, #f5fcff 49%, #b5e4ff 54%, #fff 63%);
      background-size: 300% 100%;
      background-clip: text;
      color: transparent;
      animation: brand-ice-glint 720ms ease-out both;
    }
  }
}
@keyframes brand-ice-glint {
  from { background-position: 100% center; }
  to { background-position: 0% center; }
}
body.crm-theme .top button.top-logout{background:transparent;color:#d7e0e8;border:0;padding:4px 2px;min-height:32px;font-size:13px;font-weight:400;text-decoration:underline}
body:has(#app-panel.hidden) .top-logout{display:none}
@media(max-width:600px){.top{flex-wrap:wrap;gap:8px}.top strong{flex-basis:100%}.top small{margin-left:0}.top .top-logout{margin-left:auto}}

.sale-services{container-type:inline-size;min-width:0;width:100%}
@container (max-width:480px){.sale-services .service-choices{grid-template-columns:repeat(auto-fit,minmax(min(132px,100%),1fr))}}
.sale-services .service-choice,.sale-services .cart-line>div{min-width:0;max-width:100%;overflow-wrap:anywhere}
.sale-services .service-choice>*{max-width:100%}
@container (max-width:350px){
  .sale-services .cart-line{flex-wrap:wrap}
  .sale-services .service-choice{padding:10px}
}
@media(max-width:700px){
  #workspace-nav{flex-wrap:nowrap;overflow-x:auto;max-width:100%;gap:4px;padding:4px;margin-bottom:8px;scroll-padding-inline:4px}
  
  #workspace-nav button{white-space:nowrap;min-height:40px;padding:6px 10px}
  .sale-drawer .grid,.role-preview-body form .grid{grid-template-columns:minmax(0,1fr)}
  .sale-drawer .field,.role-preview-body form .field{min-width:0}
  body:has(#app-panel) .sale-services{padding:12px}
}
.role-preview-frame[data-device="phone"] form .grid{grid-template-columns:minmax(0,1fr)}
.demo-work{display:grid;gap:12px;min-width:0}
.demo-work-heading{display:flex;align-items:center;gap:12px;padding:12px 0}
.demo-work-heading h2{margin:0 0 4px}
.demo-work-icon{display:grid;place-items:center;flex:0 0 44px;height:44px;border-radius:12px;background:var(--crm-selected);color:var(--crm-primary);font-size:24px}
.demo-work details summary{color:var(--crm-muted);cursor:pointer;padding-block:7px}
.demo-work details button{margin:4px 4px 0 0}
.demo-work-report{padding:14px;background:#f5f6fa;border-radius:8px}
.demo-work-report h3{margin:0 0 8px}
.demo-work-receipt{white-space:pre-line;overflow-wrap:anywhere;margin:8px 0 12px}
.demo-work-report button{width:100%}

.manager-preview-frame{display:block;width:100%;height:clamp(440px,72vh,850px);border:0;background:#f5f6f8}.role-preview-body:has(.manager-preview-frame){margin:0;padding:0;overflow:auto}.role-preview-frame[data-device="desktop"] .manager-preview-frame{min-width:800px}

.pay-settings{margin:16px 0 20px}.pay-settings>summary{cursor:pointer;color:var(--crm-primary);font-weight:650;min-height:var(--crm-control-height);padding:8px 0}.pay-settings[open]{padding-bottom:12px;border-bottom:1px solid #e4e2ed}.pay-accrual-heading{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:12px;margin:28px 0 8px}.pay-accrual-heading h2{margin:0}.pay-accrual-select{display:grid;gap:5px;min-width:190px}.pay-accrual-dates{max-width:720px}@media(max-width:650px){.pay-accrual-heading{align-items:start}.pay-accrual-select{min-width:150px}}

.order-detail-card {max-width:960px;padding:4px 0;color:var(--crm-ink);white-space:normal;overflow-wrap:anywhere}
.order-detail-heading h2 {margin:0;font-size:18px;line-height:1.25}
.order-people {display:flex;flex-wrap:wrap;gap:5px 20px;margin:8px 0 12px}
.order-people > div {display:flex;align-items:baseline;flex-wrap:wrap;gap:4px 7px}
.order-people dt {color:var(--crm-muted);font-size:12px}
.order-people dd {margin:0;font-weight:650;font-size:14px;font-variant-numeric:tabular-nums}
.order-overview {display:grid;gap:8px}
.order-detail-section {min-width:0;padding:12px 14px;border:1px solid var(--crm-border);border-radius:var(--crm-radius);background:var(--crm-surface)}
.order-work-panels {display:flex;flex-wrap:wrap;align-items:flex-start;gap:6px;margin-top:8px}
.order-work-panel {min-width:0;max-width:100%}
.order-work-panel > summary,.order-detail-card .order-secondary-actions > summary {
  width:fit-content;max-width:100%;min-height:var(--crm-control-height);padding:8px 12px;border-radius:var(--crm-radius);
  background:var(--crm-secondary);color:var(--crm-ink);font:600 13px/1.4 var(--crm-font);cursor:pointer
}
.order-work-panel[open] {flex-basis:100%;padding:10px 12px;border:1px solid var(--crm-border);border-radius:var(--crm-radius);background:var(--crm-surface)}
.order-work-panel[open] > summary,.order-work-panel > details {margin-bottom:8px}
.order-access-layout + div > details {margin-top:6px}
.order-detail-card :is(button,a,summary):focus-visible {outline:2px solid var(--crm-primary);outline-offset:2px}
.order-detail-section h3 {margin:0 0 12px;font-size:16px}
.order-access-layout {display:grid;align-content:start;align-items:start;grid-template-columns:minmax(0,1fr);gap:6px 20px}
.order-access-layout:has(img) {grid-template-columns:176px minmax(0,1fr);grid-template-rows:auto auto 1fr}
.order-access-layout img {display:block;width:176px;max-width:100%;height:auto;border:1px solid var(--crm-border);border-radius:6px;background:white}
.order-access-layout img {grid-column:1;grid-row:1 / span 3}
.order-access-meta {min-width:0}
.order-access-layout p {margin:3px 0;font-size:13px;color:var(--crm-muted)}
.order-access-code {display:block;margin:2px 0;color:var(--crm-ink);font:700 22px/1.3 ui-monospace,Consolas,monospace;letter-spacing:.04em;user-select:all}
.order-qr-buttons,.order-access-links,.order-corrections {display:flex;align-items:center;flex-wrap:wrap;gap:6px}
.order-qr-buttons:empty {display:none}
.order-qr-buttons:not(:empty) {margin-top:4px}
.order-detail-card a.link {display:inline-flex;align-items:center;max-width:100%;min-height:var(--crm-control-height);padding:7px 12px;border-radius:var(--crm-radius);background:var(--crm-secondary);color:var(--crm-ink);font:600 13px/1.4 var(--crm-font);text-decoration:none}
.order-detail-card :is(a.link,summary,button.secondary):hover {background:var(--crm-selected)}
.order-corrections {margin-top:10px}
.order-state-grid {display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,max(155px,18%)),1fr));gap:10px 16px;margin:0}
.order-state-fact {min-width:0;line-height:1.4}
.order-state-fact dt {font-size:12px;color:var(--crm-muted)}
.order-state-fact dd {margin:1px 0 0;font-size:13px;font-weight:600;color:var(--crm-ink)}
.order-state-comment {grid-column:1/-1}
@media(min-width:1000px) {
  .order-overview:has(> section + section) {grid-template-columns:minmax(0,1.4fr) minmax(0,1fr)}
  .order-overview .order-access-layout:has(img) {gap:4px 14px}
}
.order-detail-form{display:grid;gap:12px;margin:14px 0;max-width:760px}.order-detail-form label{display:grid;gap:7px}.order-detail-form button{justify-self:start}.order-detail-feedback:empty{display:none}.order-detail-feedback{color:var(--crm-primary);font-weight:600;white-space:pre-wrap}
.order-note{border-left:3px solid var(--crm-border);padding:4px 14px;margin:12px 0;background:var(--crm-page)}.order-note-body{white-space:pre-wrap;overflow-wrap:anywhere;color:var(--crm-ink)}.order-notes-history{margin:16px 0}.order-secondary-actions>summary{cursor:pointer;color:var(--crm-primary);font-weight:650;padding:8px 0;min-height:var(--crm-control-height)}.order-secondary-actions>button{margin:6px 8px 6px 0}.order-material-status{padding-top:18px;border-top:1px solid #e6e4ef}.order-paid{color:#28674a}
@media(max-width:700px) {
  #control-orders {container-type:inline-size}
  .order-detail-row > td {padding:10px!important}
  .order-detail-card {position:sticky;left:10px;max-width:calc(100cqw - 20px)}
  .order-detail-section {padding:14px}
  .order-access-layout {gap:8px 14px}
  .order-access-layout:has(img) {grid-template-columns:156px minmax(0,1fr);grid-template-rows:auto}
  .order-access-layout img {width:156px;grid-row:auto}
  .order-access-meta {align-self:center}
  .order-access-code {font-size:18px}
  .order-qr-buttons,.order-access-links {grid-column:1/-1}
  .order-state-grid {grid-template-columns:1fr;gap:0}
  .order-state-fact {display:grid;grid-template-columns:minmax(0,2fr) minmax(0,3fr);align-items:baseline;gap:10px;padding:5px 0}
  .order-state-fact + .order-state-fact {border-top:1px solid var(--crm-border)}
  .order-state-fact dd {margin:0}
}
@media(max-width:360px) {
  .order-access-layout:has(img) {grid-template-columns:minmax(0,1fr)}
}

.customer-support-contact{margin-top:18px}.customer-support-actions{display:flex;flex-wrap:wrap;gap:8px;margin:12px 0}.customer-support-composer{margin-top:10px}.customer-support-composer textarea{width:100%;min-height:90px;margin-bottom:8px}.customer-item-support{margin-top:16px;padding-top:14px;border-top:1px solid #e6ebef}.customer-item-support h3{margin:0 0 4px;font-size:16px}.customer-item-support .customer-support-actions{margin:8px 0}.customer-item-support .customer-support-composer{max-width:720px}

.guide-hero{display:grid;gap:8px;padding:24px;background:var(--crm-header);color:#fff;border-radius:16px;margin-bottom:16px}.guide-hero h1{margin:0}.guide-hero p{margin:0;color:#dceaf2}.guide-role-nav{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:10px}.guide-role-nav a{display:flex;align-items:center;gap:10px;padding:12px;color:#172b3d;text-decoration:none;background:#fff;border:1px solid #dfe5ea;border-radius:12px;font-weight:650}.guide-role-nav a:hover{border-color:var(--crm-primary);background:var(--crm-selected)}.guide-role-icon{display:grid;place-items:center;width:34px;height:34px;border-radius:10px;background:var(--crm-selected);font-size:20px}.guide-role-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(280px,1fr));gap:16px}.guide-role-card{margin:0}.guide-role-card .guide-role-heading{display:flex;align-items:center;gap:12px;margin-bottom:10px}.guide-role-card .guide-role-heading h2{margin:0}.guide-role-card ol,.guide-role-card ul{margin:8px 0 0;padding-left:20px}.guide-role-card li{margin:8px 0;line-height:1.45}.guide-flow{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:10px;margin-top:12px}.guide-flow-step{padding:12px;border-radius:10px;background:#f5f7fa;border:1px solid #e1e7ec}.guide-flow-step strong{display:block;margin-bottom:5px}.guide-role-card .muted{margin-top:0}@media(max-width:650px){.guide-role-grid{grid-template-columns:1fr}}
.top.guide-header { position: sticky; top: 0; z-index: 1; flex-wrap: wrap; justify-content: space-between; }
.guide-header strong { flex-basis: auto; }
.guide-return { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 14px; border-radius: 10px; background: #fff; color: #172b3d; font-weight: 650; text-decoration: none; }
.guide-return:hover, .guide-return:focus-visible { text-decoration: underline; }
.guide-role-card { scroll-margin-top: 6rem; }
@media (max-width: 400px) { .guide-role-card { scroll-margin-top: 8rem; } }

.review-confirmed .editor-stage { color: #155a41; background: #dff5e9; }
@media (prefers-reduced-motion: no-preference) {
  .review-confirmed { animation: review-confirm-card 900ms ease-out; }
  .review-confirmed .editor-stage { animation: review-confirm-badge 420ms ease-out; }
}
@keyframes review-confirm-card {
  20% { box-shadow: 0 0 0 3px #32aa7566; }
  100% { box-shadow: 0 0 0 9px transparent; }
}
@keyframes review-confirm-badge {
  from { opacity: .3; transform: translateY(4px) scale(.94); }
  to { opacity: 1; transform: none; }
}

.editor-card.editor-card-accepted {
  background: #e7f6ed;
  border-color: #77b68b;
}

.production-header #header-title { color:inherit; font-size:1.1rem; margin:0 auto 0 0; }
.production-header:has(#header-title:not(.hidden)) strong { flex-basis:auto; }

.client-portal { background:var(--crm-page); color:var(--crm-ink); }
.client-portal .wrap { max-width:800px; margin:32px auto; }
.client-portal .top { background:var(--crm-header); justify-content:space-between; padding:12px max(20px,calc((100vw - 760px)/2)); }
.client-portal .top strong { flex-basis:auto; }
.client-portal .top-logout { background:transparent; color:white; }
.client-portal .panel { border:1px solid var(--crm-border); border-radius:18px; padding:clamp(18px,4vw,32px); box-shadow:none; }
.client-portal #account>.panel { background:transparent; padding:0 2px; border:0; margin-bottom:20px; }
.client-portal h1 { font-size:clamp(26px,5vw,38px); letter-spacing:-.035em; }
.client-portal h2 { font-size:22px; letter-spacing:-.025em; }
.client-portal .film-actions { display:flex; flex-wrap:wrap; align-items:center; gap:10px; }
.film-actions .mobile-label { display:none; }
@media(max-width:650px) {
  .film-actions .desktop-label { display:none; }
  .film-actions .mobile-label { display:inline; }
  .client-portal #items .film-actions > a { padding-inline:12px; }
}
.client-portal #items .film-primary,
.client-portal #items .film-actions > a.link { display:inline-flex; align-items:center; justify-content:center; width:fit-content; max-width:100%; min-height:44px; padding:8px 16px; border-radius:var(--crm-radius); background:var(--crm-primary); color:white; font-weight:650; text-decoration:none; }
.client-portal .order-chat { display:grid; grid-template-columns:auto 1fr; align-items:center; gap:12px; }
.order-chat > button { justify-self:start; }
.order-chat h2 { margin:0; }
.order-chat #order-conversation { grid-column:1/-1; min-width:0; }
.order-chat-history { display:flex; flex-direction:column; gap:12px; max-height:330px; overflow:auto; background:var(--crm-page); border-radius:12px; padding:16px; }
.order-chat-history:empty { display:none; }
.order-message { align-self:flex-start; background:white; border:1px solid var(--crm-border); border-radius:14px 14px 14px 3px; max-width:88%; padding:10px 14px; overflow-wrap:anywhere; }
.order-message.own { align-self:flex-end; background:var(--crm-selected); border-radius:14px 14px 3px 14px; }
.order-message p { margin:4px 0; color:var(--crm-ink); white-space:pre-wrap; }
.order-message strong,.order-message time { font-size:12px; color:var(--crm-muted); }
.order-chat-form { display:flex; gap:10px; align-items:end; margin-top:12px; }
.order-chat-form textarea { min-height:52px; resize:vertical; }
.order-chat-form button { background:var(--crm-primary); }
.order-chat-feedback { margin:6px 0 0; font-size:13px; }
.client-portal [hidden] { display:none!important; }
@media(max-width:540px){.client-portal .order-chat{grid-template-columns:1fr}.order-chat>button{justify-self:start}.order-chat-form{flex-direction:column;align-items:stretch}.client-portal .wrap{margin:18px auto}}

.production-header .top-logout { background:transparent; color:inherit; padding:4px; min-height:32px; font-size:13px; font-weight:400; }
.review-summary-table { max-width:100%; overflow-x:auto; }
.review-summary-table table { border-collapse:collapse; font-size:14px; }
.review-summary-table :is(th,td) { padding:4px 8px; text-align:center; }
.review-summary-table th:first-child { text-align:left; white-space:nowrap; }


#cabinet-links{display:flex;flex-wrap:wrap;gap:6px 12px;align-items:center}#cabinet-links:empty{display:none}#cabinet-links a{margin:0}#cabinet-links [aria-current="page"]{font-weight:700}
#cabinet-sections{display:flex;flex-wrap:wrap;gap:6px 16px;margin:12px auto;max-width:1100px;padding:0 16px}#cabinet-sections:empty{display:none}#cabinet-sections a{color:#255571;font-size:14px}

.crm-theme #cabinet-sections{align-items:center;gap:10px;max-width:none;margin:0 0 18px;padding:10px;background:var(--crm-secondary);border-radius:3px}
.crm-theme #cabinet-sections a{display:inline-flex;align-items:center;min-height:var(--crm-control-height);padding:8px 15px;border-radius:var(--crm-radius);background:var(--crm-primary);color:#fff;font-size:13px;font-weight:650;text-decoration:none}
@media(max-width:700px){
  .crm-theme #cabinet-sections{flex-wrap:nowrap;overflow-x:auto;gap:4px;padding:4px;margin-bottom:8px}
  .crm-theme #cabinet-sections a{white-space:nowrap;min-height:40px;padding:6px 10px}
}

.crm-theme :where(a[href], summary) { color:var(--crm-primary); text-underline-offset:.16em; }
.crm-theme .link { color:var(--crm-primary); }
.crm-theme :where(input, progress) { accent-color:var(--crm-primary); }
.crm-theme :is(button, a[href], summary, input, select, textarea):focus-visible {
  outline:2px solid var(--crm-primary); outline-offset:2px;
}
.crm-theme .top :is(button, a):focus-visible { outline-color:white; }
.crm-theme button.danger { background:var(--crm-danger); color:white; }
.crm-theme .guide-return, .crm-theme .guide-role-nav a { border-radius:var(--crm-radius); }
.crm-theme .guide-return { background:var(--crm-secondary); color:var(--crm-ink); }
.crm-theme .top-link[aria-current="page"] { text-decoration-thickness:2px; text-underline-offset:4px; }
@media (hover:hover) {
  .crm-theme :where(button:not(:disabled), #cabinet-sections a, .film-actions a):hover { filter:brightness(.94); }
  .crm-theme :where(a[href]):hover { text-decoration:underline; }
}
.guide-role-heading .guide-edit{margin-left:auto;align-self:flex-start;flex:none;width:36px;min-height:36px;padding:4px;color:#454b55;background:transparent;font-size:20px}
.guide-role-card textarea{width:100%;margin:8px 0}
.guide-role-card form button+button{margin-left:8px}

#cabinet-links{gap:6px}
#cabinet-links .top-link{display:inline-flex;align-items:center;justify-content:center;min-height:36px;padding:6px 12px;border:1px solid var(--nav-tab-border,#6487aa);border-radius:var(--crm-radius);background:var(--nav-tab,#20476e);color:#fff;text-decoration:none;line-height:1.25}
#cabinet-links .top-link:hover{background:var(--nav-tab-hover,#2d5883)}
#cabinet-links .top-link[aria-current="page"]{background:#fff;color:var(--crm-ink);border-color:#fff;box-shadow:inset 0 -3px var(--crm-primary);font-weight:700}
#cabinet-links .top-link:focus-visible{outline:2px solid white;outline-offset:2px}
.crm-theme .top:has(#cabinet-links:not(:empty)){display:grid;grid-template-columns:minmax(9rem,14rem) minmax(0,1fr) auto;align-items:center;gap:12px}
@media(max-width:600px){
  .crm-theme .top:has(#cabinet-links:not(:empty)){grid-template-columns:minmax(0,1fr) auto}
  .crm-theme .top #cabinet-links{grid-column:1/-1;grid-row:2}
  .crm-theme .top .top-logout{grid-column:2;grid-row:1}
}
.employee-avatar{justify-self:end;align-self:start;display:block;width:40px;height:40px;border-radius:50%;overflow:hidden}
.employee-avatar[hidden]{display:none}
.employee-avatar img{display:block;width:100%;height:100%}
@media(max-width:600px){.crm-theme .top .employee-avatar{grid-column:2;grid-row:1}}
#operation-history,#operation-repair,#avatar-editor{width:min(26rem,94vw);max-height:90dvh;overflow:auto;border:0;border-radius:12px;padding:22px;color:inherit}
#operation-history::backdrop,#operation-repair::backdrop,#avatar-editor::backdrop{background:rgb(18 22 31 / 65%)}
#operation-repair form{display:grid;gap:.75rem}
#operation-repair label{display:grid;gap:.25rem}
#operation-repair label:has([type=checkbox]){display:flex;align-items:center;gap:.5rem}
#operation-repair label [type=checkbox]{width:auto}
#operation-history{width:min(40rem,94vw)}
#operation-history-id,#operation-repair-id,#operation-events{overflow-wrap:anywhere}
#operation-events{display:grid;gap:1rem;padding-inline-start:1.75rem}
#operation-events li{display:list-item}
#operation-events small{display:block}
#operation-repair h2,#avatar-editor h2{margin-top:0}
#avatar-preview{display:block;width:min(100%,300px);height:auto;margin:16px auto;border-radius:50%;outline-offset:3px;touch-action:none;cursor:grab}
#avatar-preview:active{cursor:grabbing}
#avatar-zoom{width:100%}
#avatar-message:empty{display:none}
#avatar-editor .row{justify-content:flex-end;margin-top:16px}
.crm-theme .top .employee-avatar{display:grid;justify-items:center;align-content:start;gap:2px;width:clamp(7rem,13vw,12rem);height:auto;border-radius:4px;text-decoration:none;color:#fff;text-align:center;overflow-wrap:anywhere}
.crm-theme .top .employee-avatar[hidden],.employee-avatar img[hidden]{display:none}
.avatar-circle{display:grid;place-items:center;position:relative;width:40px;height:40px;margin-bottom:3px;overflow:hidden;border-radius:50%;background:#55536c;color:#fff;font-weight:650}
.avatar-circle img{position:absolute;inset:0}
.avatar-role{color:#ced2e0;font-size:12px;line-height:1.2}
.crm-theme .top .avatar-name{font-size:14px;line-height:1.25;font-weight:650}

#queue-alerts {
  position: fixed;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  width: min(30rem, calc(100% - 2rem));
  z-index: 1000;
}
#queue-alerts:empty { display: none; }
#queue-alerts .status {
  box-sizing: border-box;
  margin: 0;
  max-height: 80dvh;
  overflow: auto;
  overflow-wrap: anywhere;
  background: #fff7e6;
  color: #412e16;
  padding: 1rem;
  border-radius: .75rem;
  box-shadow: 0 .5rem 2rem #0003;
}
#queue-alerts button { margin: .25rem .5rem .25rem 0; }

#orders-view-field[hidden],#orders-create[hidden],#transfer-body [hidden]{display:none}
#transfer-body form{max-width:32rem;display:grid;gap:.85rem}
#transfer-body form p{margin:0}
#transfer-body .transfer-close{display:flex;align-items:center;gap:.55rem;min-height:2.5rem;cursor:pointer}
#transfer-body input[type=checkbox]{flex:none;width:1.15rem;height:1.15rem;min-height:0;margin:0}
#transfer-body .field{gap:.7rem}
@media(min-width:701px){.order-filters:has(#orders-view-field:not([hidden])){max-width:1000px;grid-template-columns:1.5fr 1.25fr 1fr 1fr}}

#workspace-nav:not(:has(button:not(.hidden):not([hidden]))){display:none}
.shift-start{display:flex;justify-content:center}
.shift-start:not(:empty){margin:16px 0}
.shift-start button{min-width:11rem}
.manager-account,.manager-tools{display:flex;align-items:center;gap:12px}
.manager-account{justify-self:end}
.manager-account .employee-avatar{max-width:8.5rem}
.manager-tools [hidden]{display:none!important}
.header-cash{position:relative}
.header-cash summary{display:grid;gap:2px;cursor:pointer;list-style:none;min-height:40px;align-content:center}
.header-cash summary::-webkit-details-marker{display:none}
.header-cash summary span{font-size:.75rem;color:#d8dce4}
.crm-theme .top .header-cash summary strong{color:white;white-space:nowrap;font-variant-numeric:tabular-nums}
.cash-breakdown{position:absolute;z-index:25;inset-inline-end:0;top:100%;min-width:15rem;padding:14px;background:white;color:#252b36;border:1px solid #d7dce5;border-radius:8px;box-shadow:0 7px 24px #19243826}
.cash-breakdown small{display:block;color:#586473;margin:3px 0 10px}
.cash-method{display:flex;justify-content:space-between;gap:1rem;font-size:.875rem;padding:4px 0}
.crm-theme .top .header-close-shift{font-size:.8rem;background:transparent;color:white;border:1px solid #89939f;border-radius:6px;min-height:36px;padding:5px 10px}
@media(max-width:850px){
 .crm-theme .top:has(.manager-account){grid-template-columns:minmax(0,1fr) auto}
 .crm-theme .top:has(.manager-account) #cabinet-links{grid-column:1/-1;grid-row:2}
 .manager-account{grid-column:2;grid-row:1}
}
@media(max-width:600px){
 .crm-theme .top:has(.manager-account){grid-template-columns:1fr;gap:10px}
 .manager-account{grid-column:1;grid-row:2;width:100%;justify-content:space-between}
 .crm-theme .top:has(.manager-account) #cabinet-links{grid-row:3}
 .cash-breakdown{inset-inline-start:0;inset-inline-end:auto}
}

.cash-breakdown .cash-method small{margin:0;font-size:.75rem}

.crm-theme #status {width:fit-content;max-width:min(100%,38rem);overflow-wrap:anywhere;padding:7px 12px}
.crm-theme .top:has(.manager-account) {padding-block:8px;min-height:54px}
.crm-theme .manager-account .employee-avatar:not([hidden]) {width:auto;max-width:15rem;grid-template-columns:32px minmax(0,1fr);align-items:center;align-self:center;justify-items:start;gap:0 8px;text-align:left}
.manager-account .avatar-circle {grid-row:1 / 3;width:32px;height:32px;margin:0}
.manager-account .avatar-circle img {width:100%;height:100%;object-fit:cover}
.manager-account .avatar-name,.manager-account .avatar-role {grid-column:2}

/* Keep the skis and board inside the profile link, including on narrow screens. */
.employee-avatar .avatar-circle:has(img:not([hidden])) {
  --mascot-size:clamp(64px,6vw,84px);
  width:var(--mascot-size);height:var(--mascot-size);border-radius:12px;background:#eaf2f3;
}
.employee-avatar .avatar-circle:has(img:not([hidden])) .avatar-initials {visibility:hidden}
.employee-avatar .avatar-circle img {object-fit:contain}
.crm-theme .manager-account .employee-avatar:has(img:not([hidden])) {grid-template-columns:auto minmax(0,1fr)}

.crm-theme .top .employee-avatar:not([hidden]) {
  display:grid;grid-template-columns:40px minmax(0,1fr);align-self:center;align-items:center;
  justify-items:start;align-content:center;gap:1px 9px;width:auto;max-width:14rem;text-align:left;
}
.crm-theme .top .employee-avatar .avatar-circle {
  --mascot-size:40px;grid-row:1/span 2;width:40px;height:40px;margin:0;
}
.crm-theme .top .employee-avatar :is(.avatar-role,.avatar-name) {grid-column:2}
.crm-theme .top:has(#cabinet-links:not(:empty)) {padding-block:9px}
@media(max-width:600px){
  .crm-theme .top .employee-avatar:not([hidden]) {max-width:10rem;grid-template-columns:32px minmax(0,1fr);column-gap:6px}
  .crm-theme .top .employee-avatar .avatar-circle {width:32px;height:32px}
}

.crm-theme .top .header-open-cash {background:var(--crm-secondary);color:var(--crm-primary-hover);min-height:36px;white-space:nowrap;border-radius:7px}
@media(max-width:760px){.manager-account .manager-tools {flex-wrap:wrap;gap:6px}}

.questionnaire-tabs { display: flex; flex-wrap: wrap; gap: 5px; padding-bottom: 12px; margin: 0 0 12px; border-bottom: 1px solid var(--crm-border); }
.questionnaire-tabs button { background: var(--crm-secondary); color: var(--crm-ink); }
.questionnaire-tabs button[aria-pressed=true] { background: var(--crm-primary); color: white; }
#questionnaire-panel > section { max-width: 54rem; }
#questionnaire-panel > section[hidden] { display: none; }
#questionnaire-questions .questionnaire-question { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 14px; padding: 14px; margin: 12px 0; }
.questionnaire-question .field { min-width: 0; margin: 0; }
.questionnaire-question > button { justify-self: start; }
.questionnaire-question input[type=checkbox] { width: 18px; height: 18px; min-height: 0; }
#questionnaire-bots details { padding: 10px 0; border-bottom: 1px solid var(--crm-border); }
@media(max-width: 640px) { #questionnaire-questions .questionnaire-question { grid-template-columns: minmax(0, 1fr); } }

/* Navigation for the resort manager */
#cabinet-links .resort-menu { position:relative; }
#cabinet-links .resort-menu summary { cursor:pointer; list-style:none; gap:.5em; }
#cabinet-links .resort-menu summary::-webkit-details-marker { display:none; }
#cabinet-links .resort-menu summary::after { content:""; width:.42em; height:.42em; border:solid currentColor; border-width:0 1.5px 1.5px 0; transform:rotate(45deg) translateY(-2px); }
#cabinet-links .resort-menu[open] summary::after { transform:rotate(225deg) translateY(-2px); }
#cabinet-links .resort-menu:has([aria-current="page"]) summary { background:white; color:var(--crm-ink); box-shadow:inset 0 -3px var(--crm-primary); }
.resort-menu-links { position:absolute; top:calc(100% + 4px); left:0; z-index:30; display:grid; width:max-content; max-width:calc(100vw - 32px); max-height:65vh; overflow:auto; padding:6px; background:white; border:1px solid #bdd1e6; border-radius:10px; box-shadow:0 8px 24px #102c4826; }
#cabinet-links .resort-menu-links .top-link { justify-content:flex-start; border:0; background:white; color:var(--crm-ink); }
#cabinet-links .resort-menu-links .top-link:is(:hover,:focus-visible,[aria-current="page"]) { background:var(--crm-selected); color:var(--crm-ink); }
body:has(#cabinet-links.grouped-workspace) #workspace-nav { background:transparent; padding:0; }
body:has(#cabinet-links.grouped-workspace) #workspace-nav > :not(#workspace-back),
body:has(#cabinet-links.grouped-workspace) #workspace-nav:has(#workspace-back.hidden) { display:none; }
@media (max-width:700px) {
  #cabinet-links:has(.resort-menu) { position:relative; }
  #cabinet-links .resort-menu { position:static; }
  .resort-menu-links { top:auto; margin-top:4px; right:0; width:auto; }
}

#questionnaire-panel > section {max-width:85rem;}
.editor-layout {display:grid;grid-template-columns:minmax(0,1.55fr) minmax(18rem,1fr);align-items:start;gap:clamp(16px,3vw,38px);}
.editor-layout > * {min-width:0;}
.editor-preview {position:sticky;top:12px;max-height:calc(100vh - 24px);overflow:auto;padding:16px;background:#edf5fc;border:1px solid #c6daed;border-radius:14px;overflow-wrap:anywhere;}
.editor-preview h3,.notice-editor h3 {font-size:1rem;margin:0 0 12px;}
.editor-preview h4 {margin:0 0 14px;font-size:1.12rem;}
.preview-paper,.bot-sample {padding:16px;background:white;border:1px solid #d2e0ee;border-radius:10px;}
.preview-paper .field {margin-bottom:12px;}
.preview-paper .field:last-child {margin-bottom:0;}
.editor-layout [hidden] {display:none!important;}
.editor-preview small,.question-rules small,#customer-notice-mode {color:#4a637b;}
.question-rules {grid-column:1/-1;min-width:0;margin:0;padding:8px 10px;border:1px solid #d3e2ef;border-radius:8px;}
.question-rules legend {font-weight:600;font-size:.88rem;}
.question-rules > div > div {display:flex;align-items:center;gap:6px;margin:4px 0;}
.question-rules select {min-width:0;}
.question-rules button,.notice-editor button {width:fit-content;}
.notice-editor {padding:14px 16px;border:1px solid #cfdeed;border-radius:12px;}
.notice-editor .compact-form {gap:8px;max-width:none;}
.notice-editor textarea {min-height:4.5rem;}
.notice-editor p:empty {display:none;}
#notice-preview + a,#customer-notice-settings {display:inline-block;margin-top:10px;font-size:.9rem;}
.notice.resort-announcement {white-space:pre-wrap;overflow-wrap:anywhere;border:1px solid #c2d9f1;border-inline-start:3px solid #236ab1;background:#edf5ff;color:#153d69;border-radius:8px;padding:10px 14px;}
#bot-settings .editor-layout {margin-top:12px;}
#bot-settings .editor-preview label {display:block;margin:8px 0;}
#bot-settings .editor-preview input[type=checkbox] {width:auto;min-height:0;}
.bot-sample p {white-space:pre-wrap;margin:0;}
.bot-example-actions {display:grid;gap:4px;}
.bot-example-actions span {padding:7px 10px;text-align:center;color:#174d84;background:#e5f0fc;border-radius:7px;margin-top:4px;}
@media(max-width:780px){
 .editor-layout {grid-template-columns:minmax(0,1fr);}
 .editor-preview {position:static;max-height:none;}
}

.questionnaire-music-link {
  display:inline-flex;align-items:center;align-self:start;width:fit-content;min-height:44px;
  padding:8px 16px;margin:0 0 12px;border-radius:var(--crm-radius);
  background:rgb(80 89 98 / 6%);border:1px solid rgb(80 89 98 / 32%);
  color:#414a53;font-weight:600;text-decoration:none;
}
.questionnaire-music-link:hover {background:rgb(80 89 98 / 12%);border-color:rgb(80 89 98 / 48%);}
.question-choices {display:flex;gap:8px;flex-wrap:wrap;min-width:0;}
.question-choices label {display:inline-flex;align-items:center;gap:8px;max-width:100%;min-height:44px;padding:6px 12px;border:1px solid var(--crm-border);border-radius:var(--crm-radius);cursor:pointer;}
.question-choices label span {min-width:0;overflow-wrap:anywhere;}
.question-choices input[type=checkbox] {flex:none;width:18px;height:18px;min-height:0;margin:0;}
.question-choices label:has(:checked) {background:var(--crm-selected);border-color:var(--crm-primary);}

.question-music-field {grid-column:1/-1;align-items:flex-start;}
.question-music-field[hidden] {display:none;}
.question-example {grid-column:1/-1;}
.question-example input {margin-top:6px;}
.answer-with-example::placeholder {color:rgb(45 56 68 / 68%);opacity:1;}
.question-tools {display:flex;align-items:center;gap:8px 16px;flex-wrap:wrap;grid-column:1/-1;}
.question-tools label {display:inline-flex;align-items:center;gap:6px;cursor:pointer;}
.question-tools .question-music-toggle {
  display:inline-grid;place-items:center;width:36px;min-height:36px;padding:0;
  border:1px solid rgb(80 89 98 / 25%);border-radius:8px;background:rgb(80 89 98 / 5%);
  color:#414a53;font:600 18px/1 system-ui,sans-serif;
}
@media (pointer:coarse) {.question-tools .question-music-toggle {width:44px;min-height:44px;}}
.question-music-field label {width:100%;}
.question-music-field .questionnaire-music-link {margin:0;}

.question-studio {
  display:grid;gap:14px;align-items:start;
  grid-template-columns:minmax(10rem,.75fr) minmax(17rem,1.4fr) minmax(15rem,1fr);
  grid-template-areas:"header header header" "outline editor preview";
}
.question-studio form {display:contents;}
.question-studio .studio-header {grid-area:header;display:grid;grid-template-columns:repeat(2,minmax(0,1fr)) auto;align-items:end;gap:8px 14px;}
.studio-header .field {margin:0;}
.studio-header [role=status] {grid-column:1/-1;}
.studio-header [role=status]:empty {display:none;}
.question-studio .studio-outline,.question-studio .studio-editor {
  min-width:0;padding:14px;background:white;border:1px solid var(--crm-border);border-radius:14px;
}
.studio-outline {grid-area:outline;}
.studio-editor {grid-area:editor;}
.question-studio .editor-preview {grid-area:preview;min-width:0;}
[data-resort-theme="polyana"] .editor-preview {background:var(--crm-page);border-color:var(--crm-border);}
[data-resort-theme="polyana"] .questionnaire-question {accent-color:var(--crm-primary);}
[data-resort-theme="polyana"] .question-choices label:has(:checked) {background:var(--crm-selected);border-color:var(--crm-primary);}
.question-studio h3 {margin:0 0 12px;font-size:1rem;}
#question-outline {display:grid;gap:4px;margin-bottom:10px;}
#question-outline button {display:flex;gap:9px;align-items:baseline;text-align:left;background:transparent;color:var(--crm-ink);padding:8px;border:1px solid transparent;}
#question-outline button[aria-current=step] {background:var(--crm-selected);border-color:var(--crm-border);font-weight:700;}
#question-outline button span:first-child {font-variant-numeric:tabular-nums;color:var(--crm-primary);}
#question-outline button span:last-child {min-width:0;overflow-wrap:anywhere;}
#questionnaire-questions .questionnaire-question {grid-template-columns:minmax(0,1fr);padding:0;margin:0;border:0;box-shadow:none;background:transparent;}
.question-studio [hidden] {display:none!important;}
.question-studio .questionnaire-question details label {margin-top:8px;}
.question-studio .preview-current {border-inline-start:3px solid var(--crm-primary);padding-inline-start:10px;}
@media(max-width:920px) {
  .question-studio {grid-template-columns:minmax(0,1.2fr) minmax(0,1fr);grid-template-areas:"header header" "outline preview" "editor preview";}
}
@media(max-width:640px) {
  .question-studio {grid-template-columns:minmax(0,1fr);grid-template-areas:"header" "outline" "editor" "preview";}
  .question-studio .studio-header {grid-template-columns:minmax(0,1fr);align-items:start;}
  .studio-header button {justify-self:start;}
}

.cart-line .sale-editor-choice {display:flex;align-items:center;gap:7px;font-size:.88rem;font-weight:500;margin-top:6px;}
.cart-line .sale-editor-choice input {width:18px;height:18px;min-height:0;flex:none;}
.cart-line label:not(.sale-editor-choice):not([hidden]) {display:grid;gap:4px;margin-top:8px;font-size:.9rem;}
.cart-line label[hidden] {display:none;}
.cart-line input[type=number] {max-width:9rem;}
.cart-line textarea {min-height:3.5em;resize:vertical;}
.editor-brief-note {white-space:pre-wrap;overflow-wrap:anywhere;}
/* The two ridges follow the silhouettes on the guest film brief. */
:root {
  --crm-page: #f4f7fa;
  --crm-ink: #142f4b;
  --crm-muted: #526b7b;
  --crm-radius: 10px;
  --ridge-start: #243d58;
  --ridge-end: #375e82;
  --ridge-far: #86a7bb;
  --ridge-near: #e0edf3;
  --ridge-back-shape: polygon(0 100%,19% 75%,26% 80%,42% 45%,48% 54%,68% 15%,74% 25%,80% 20%,100% 52%,100% 100%);
  --ridge-front-shape: polygon(0 100%,25% 91%,44% 67%,52% 74%,77% 43%,82% 50%,100% 29%,100% 100%);
}
[data-resort-theme="arkhyz"] {
  --ridge-start: #10285c;
  --ridge-end: #0032c8;
  --ridge-far: #87afc2;
  --ridge-near: #dfedf3;
  --crm-border: #c1d8e3;
  --crm-page: #f3f7fa;
  --crm-ink: #142f4b;
  --crm-muted: #526b7b;
}
[data-resort-theme="polyana"] {
  --ridge-start: #63251f;
  --ridge-end: #cb3724;
  --ridge-far: #e4a48e;
  --ridge-near: #fff0e8;
  --crm-border: #e3ccd4;
  --crm-page: #faf6f4;
  --crm-ink: #321c2a;
  --crm-muted: #695760;
}
:where(.crm-theme .top) { position: relative; }
.crm-theme .top, .studio-masthead,
#resort-cards .resort-card:is([data-resort-theme="arkhyz"],[data-resort-theme="polyana"]) {
  isolation: isolate;
  --resort-header-art: linear-gradient(112deg,var(--ridge-start),var(--ridge-end));
  background-image: var(--resort-header-art);
}
body.crm-theme .top { background-image: linear-gradient(112deg,var(--ridge-start),var(--ridge-end)); }
.crm-theme .top::before, .crm-theme .top::after,
.studio-masthead::before, .studio-masthead::after,
#resort-cards .is-branded::before, #resort-cards .resort-card.is-branded::after {
  content: "";
  position: absolute;
  pointer-events: none;
  z-index: -1;
  right: 0;
  bottom: 0;
  width: var(--ridge-width, 48%);
  height: 80%;
  background: var(--ridge-far);
  clip-path: var(--ridge-back-shape);
  mask: none;
}
.crm-theme .top::after, .studio-masthead::after, #resort-cards .resort-card.is-branded::after {
  height: 55%;
  background: var(--ridge-near);
  clip-path: var(--ridge-front-shape);
  opacity: 1;
}
.crm-theme .top { --ridge-width: min(32%,480px); }
.crm-theme .top::before, .crm-theme .top::after { opacity: .14; }
.crm-theme #resort-cards .is-branded { --ridge-width: 47%; border-radius: 18px; }
body.crm-theme :is(#resort-cards,#location-cards) button:focus-visible { outline: 3px solid var(--crm-primary); outline-offset: 3px; }
body.crm-theme #location-cards .resort-card { border-radius: 16px; border-top-width: 3px; }
body.crm-theme #login-panel { overflow: hidden; border-radius: 19px; }
body.crm-theme #login-panel > h1 {
  margin: -20px -20px 18px;
  padding: 22px 20px;
  background: linear-gradient(112deg,var(--ridge-start),var(--ridge-end));
  color: white;
  letter-spacing: -.035em;
}
.crm-theme #cabinet-sections, .crm-theme #workspace-nav {
  background: var(--crm-surface); border: 1px solid var(--crm-border); border-radius: 12px;
}
.crm-theme #cabinet-sections:empty { display:none; }
.crm-theme #cabinet-sections a, #workspace-nav button:not(.active) {
  background: transparent; color: var(--crm-ink); border-radius: 6px;
}
.crm-theme #cabinet-sections a[aria-current="page"], #workspace-nav button.active {
  color: var(--crm-primary-hover); background: var(--crm-selected);
  box-shadow: inset 0 -3px var(--crm-primary); text-decoration: none;
}
@media (max-width:700px) {
  body:has(#app-panel:not(.hidden) > #operator-panel:not(.hidden,.screen-hidden) .operator-workspace-ready) > .top:not(:has(.manager-tools)) { display:none; }
  body:has(#app-panel:not(.hidden) > #operator-panel:not(.hidden,.screen-hidden) .operator-workspace-ready) > .top:has(.manager-tools) :is(.brand-home,#cabinet-links,#employee-avatar) { display:none; }
  body.crm-theme main.wrap:has(> #app-panel:not(.hidden) > #operator-panel:not(.hidden,.screen-hidden) .operator-workspace-ready) { margin:0 auto; padding:0; }
  body.crm-theme #operator-panel { padding:0; border:0; background:transparent; }
  #operator-panel > .row:has(label:not(.hidden)) { margin:8px 0; }
  #operator-message:empty,#operator-panel > .row:has(> label.hidden:only-child) { display:none; }
}
.bot-sample img {display:block;width:100%;max-width:380px;border-radius:10px}
.bot-sample img[hidden] {display:none}
.bot-sample .bot-example-actions .bot-primary {background:#17659e;color:white;font-weight:650}
