/* DESIGN-01: composed screens use the PolyRental Figma spacing and surfaces.
   Telegram theme variables remain the source of runtime colours. */
:root { --view-gap: 16px; --card-radius: 12px; }
.release-items { display:grid; gap:16px; }
.release-items section + section { padding-top:16px; border-top:1px solid var(--line); }
.release-items h3 { margin:0 0 6px; font-size:16px; line-height:1.4; }
.release-items p { margin:0; color:var(--muted); line-height:1.5; }
.release-actions { display:grid; gap:10px; margin-top:6px; }
#release-dialog .dialog-card { max-height:88dvh; overscroll-behavior:contain; }
#release-dialog .button { white-space:normal; }
#support-result.success { padding:12px; border-radius:12px; background:color-mix(in srgb,#228b59 14%,var(--surface)); color:var(--text); }
.external-period { display:grid; gap:12px; }
.external-period[hidden] { display:none; }
.external-time-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.external-time-grid .field { min-width:0; margin:0; }
.external-time-grid input { min-width:0; width:100%; }
.external-warning { margin:0; }
.external-warning.has-overlap { padding:12px; border-radius:12px; background:color-mix(in srgb,#c48a16 16%,var(--surface)); border:1px solid color-mix(in srgb,#c48a16 50%,var(--line)); }
.calendar-day.calendar-day-busy:not(.selected):not(.in-range) { background:color-mix(in srgb,#c48a16 18%,var(--surface)); }
.calendar-day.calendar-day-busy::after { content:""; position:absolute; bottom:4px; left:calc(50% - 2px); width:4px; height:4px; border-radius:50%; background:currentColor; }
.external-calendar .calendar-day { position:relative; }
.external-calendar .calendar-weekdays,
.external-calendar .calendar-days { grid-template-columns:repeat(7,minmax(0,1fr)); }
.external-calendar .calendar-day { min-width:0; }
.range-calendar.external-calendar .calendar-day.selected { background:var(--accent); }
.range-calendar.external-calendar .calendar-day.in-range { background:color-mix(in srgb,var(--accent) 14%,var(--surface)); }
.shell, .dates-view .shell { padding-top: max(20px, env(safe-area-inset-top), var(--tg-content-safe-area-inset-top, 0px)); padding-left: max(20px, env(safe-area-inset-left), var(--tg-content-safe-area-inset-left, 0px)); padding-right: max(20px, env(safe-area-inset-right), var(--tg-content-safe-area-inset-right, 0px)); }
.topbar, .dates-view .topbar { min-height: 24px; padding: 0; margin-bottom: 16px; border: 0; }
.brand { font-size: 16px; line-height: 24px; font-weight: 700; letter-spacing: 0; }
.brand-mark, .topbar-note, .step-kicker { display: none; }
.panel-head, .dates-view #step-dates .panel-head { margin: 0 0 16px; gap: 12px; }
.panel-head h2, .dates-view #step-dates h2 { font-size: 24px; font-weight: 700; line-height: 1.2; letter-spacing: -.025em; }
.button { min-height: 48px; padding: 14px 16px; font-size: 14px; font-weight: 700; border-radius: var(--card-radius); }
.button.compact { min-height: 44px; }
.field { gap: 8px; margin-bottom: 16px; font-size: 14px; }
.field input, .field select, .field textarea { font-size: 16px; }
.contact-card, .review-group, .identity-section, #consent-step, .admin-card, .order-card, .request-next-overview, .catalog-controls, .receipt-section { padding: 16px; border: 0; border-radius: var(--card-radius); background: var(--surface); box-shadow: none; }
.review-group, .review-group:last-child { border: 0; }
.contact-card h3, .identity-section h3, .review-heading, .receipt-section h3 { font-size: 16px; line-height: 24px; font-weight: 700; }
.supporting, .customer-order-period, .customer-order-items, .item-description { font-size: 14px; }
.catalog-period { padding: 16px; margin: 0 0 16px; border-radius: var(--card-radius); background: var(--surface); }
.items-grid { gap: 16px; }
.item-card, .item-card.selected { padding: 16px; border: 1px solid transparent; border-radius: var(--card-radius); }
.item-card.selected { border-color: var(--accent); }
.item-main .item-name { font-size: 16px; line-height: 1.4; }
.item-main p, .available-badge { font-size: 14px; }
.item-card .item-photo, .item-card .item-placeholder { width: 80px; height: 96px; }
.item-card, .item-card.selected { grid-template-columns: 80px minmax(0, 1fr); min-height: 128px; }
.dates-view .date-grid { grid-template-columns: 1fr; gap: 0; margin: 0 0 16px; padding: 0 16px; border-radius: var(--card-radius); background: var(--surface); }
.dates-view .date-grid .field { padding: 16px 0; border: 0; border-radius: 0; background: transparent; }
.dates-view .date-grid .field + .field { border-top: 1px solid var(--line); }
.dates-view .date-grid .field > span { font-size: 16px; line-height: 24px; }
.dates-view .date-grid input:is([type=time], .keyboard-time) { max-width: 180px; background: var(--surface); }
.range-calendar { border-radius: 16px; padding: 16px; }
.date-instruction { margin-bottom: 16px; }
.admin-tabs { margin-bottom: 16px; }
.admin-settings { margin-bottom: 16px; }
.catalog-controls { gap: 12px; margin: 0 0 16px; }
.catalog-summary { margin: 16px 0; }
.catalog-toolbar { flex-direction: column; gap: 12px; margin: 16px 0; }
.catalog-toolbar > .button { width: 100%; flex: none; min-height: 48px !important; text-align: left; }
.article-card { margin-top: 16px; }
.article-card-head { grid-template-columns: 64px minmax(0, 1fr); align-items: start; }
.article-main h3 { font-size: 16px; line-height: 24px; }
.article-main .article-type { margin-top: 0; }
.article-meta { font-size: 14px; }
.equipment-row { padding: 16px 0; }
.equipment-list { margin-top: 12px; }
.catalog-operations { margin: 16px 0; background: var(--surface); border: 0; }
.editor-card { padding: 0; background: transparent; }
.editor-card h3 { margin: 0 0 16px; font-size: 24px; line-height: 1.2; }
.editor-card .catalog-form > .field { padding: 16px; margin: 0; background: var(--surface); border-radius: var(--card-radius); }
.editor-card .catalog-form { gap: 16px; }
.editor-card .catalog-form > .action-row { margin: 0; }
.request-card, .customer-order-card { padding: 0; }
.request-next-overview { margin-top: 16px; background: var(--surface); border: 1px solid var(--line); }
.request-next-overview h4 { font-size: 16px; }
.request-section h4 { font-size: 16px; }
.request-card .action-row > .workflow-next { min-height: 48px; border: 0; padding: 14px 16px; font-size: 14px; box-shadow: none; }
.request-card .action-row > .workflow-next::after { display: none; }
.receipt-summary { display: grid; gap: 16px; }
.receipt-section h3, .receipt-section p { margin: 0; }
.receipt-section ul { margin: 8px 0 0; padding-left: 20px; }
.receipt-section li { margin-top: 8px; overflow-wrap: anywhere; }
.receipt-section { border: 1px solid var(--line); }
.workflow-dialog .dialog-card { gap: 16px; }
.workflow-dialog .action-row > .button { min-height: 48px; }
.profile-version { margin-top: 16px; color: var(--muted); font-size: 12px; }
@media (max-width: 620px) {
  .form-grid { grid-template-columns: 1fr; }
  .action-row > .button { min-height: 48px; }
  .action-bar .button { text-align: left; }
}
@media (max-width: 359px) {
  .dates-view .shell { padding-left: 6px; padding-right: 6px; }
  .dates-view .range-calendar { padding-left: 0; padding-right: 0; }
  .item-card, .item-card.selected { grid-template-columns: 1fr; }
  .item-card .item-photo, .item-card .item-placeholder { width: 100%; height: 100px; }
}

button, summary { -webkit-tap-highlight-color: transparent; }
.dates-view .date-grid .field { padding-top: 12px; padding-bottom: 12px; }
.dates-view .date-grid input:is([type=time], .keyboard-time) { border-color: transparent; padding-left: 0; }

#admin-panel.catalog-editing > .panel-head, #admin-panel.catalog-editing > .admin-tabs, #admin-panel.catalog-editing > .admin-settings { display: none; }

.receipt-pages { display: grid; gap: 16px; min-width: 0; }
.receipt-pages figure { margin: 0; min-width: 0; }
.receipt-pages figcaption { margin: 0 0 8px; color: var(--muted); font-size: 13px; }
.receipt-pages canvas { display: block; width: 100%; height: auto; background: white; border: 1px solid var(--line); }
.receipt-pdf-preview > .receipt-download { width: 100%; margin-top: 16px; }

/* Browser theme and responsive layout */
:root[data-theme="light"] { --bg:#f3f6fb; --surface:#fff; --text:#17243d; --muted:#68758b; --accent:#3157d5; --on-accent:#fff; --danger:#a92b35; }
:root[data-theme="dark"] { --bg:#17212b; --surface:#232e3c; --text:#fff; --muted:#b4c0cc; --accent:#90adff; --on-accent:#102141; --danger:#ff8993; }
.theme-switch { display:flex; gap:2px; padding:3px; border:1px solid var(--line); border-radius:12px; background:var(--bg); }
.theme-switch label { position:relative; cursor:pointer; }
.theme-switch input { position:absolute; opacity:0; width:1px; height:1px; }
.theme-switch span { display:block; padding:7px 10px; border-radius:9px; color:var(--muted); font-size:12px; font-weight:700; transition:background .2s, color .2s, box-shadow .2s; }
.theme-switch input:checked + span { background:var(--surface); color:var(--text); box-shadow:0 2px 8px #0002; }
.theme-switch input:focus-visible + span { outline:3px solid var(--accent); outline-offset:2px; }
@media (min-width: 1100px) {
  .shell { max-width:1440px; padding-left:40px; padding-right:40px; }
  .tabs, .action-bar { width:min(1440px, 100%); padding-left:40px; padding-right:40px; }
  .items-grid.items-grid-tiles { grid-template-columns:repeat(auto-fill, minmax(230px, 1fr)); }
  .dates-view .date-grid { grid-template-columns:repeat(2, minmax(0, 1fr)); gap:24px; }
  .dates-view .date-grid .field + .field { border-top:0; }
  .range-calendar { max-width:850px; }
}
.login-page { min-height:100vh; }
.login-shell { max-width:1200px; min-height:100vh; margin:auto; padding:24px clamp(20px, 4vw, 48px); }
.login-header { display:flex; align-items:center; justify-content:space-between; gap:16px; }
.login-card { max-width:620px; margin:clamp(48px, 12vh, 140px) auto 40px; padding:clamp(28px, 5vw, 56px); border:1px solid var(--line); border-radius:24px; background:var(--surface); box-shadow:0 24px 70px #152b5012; }
.login-icon { display:grid; place-items:center; width:56px; height:56px; margin-bottom:32px; border-radius:18px; background:var(--soft); color:var(--accent); font:700 32px Georgia,serif; }
.login-card h1 { font-size:clamp(34px, 5vw, 50px); }
.login-description { max-width:430px; margin:18px 0 28px; color:var(--muted); line-height:1.6; }
.login-widget { min-height:40px; }
.login-hint { margin:16px 0 0; color:var(--muted); font-size:13px; }
@media (max-width:420px) { .topbar, .login-header { flex-wrap:wrap; } .theme-switch span { padding:7px 8px; } }
@media (prefers-reduced-motion: no-preference) {
  .button, .item-card, .tab { transition:background-color .2s, border-color .2s, color .2s, box-shadow .2s, transform .2s; }
  .button:not(:disabled):hover, .item-card:hover { transform:translateY(-2px); }
  .step-panel:not([hidden]), .login-card { animation:surface-enter .35s ease-out both; }
  @keyframes surface-enter { from { opacity:0; } to { opacity:1; } }
}
@media (prefers-reduced-motion: reduce) { .theme-switch span { transition:none; } }

/* Centered identity and theme control in the profile. */
.topbar, .dates-view .topbar, .login-header { position:relative; display:flex; justify-content:center; text-align:center; }
.topbar .brand, .login-header .brand { display:flex; flex-direction:column; justify-content:center; gap:2px; }
.topbar > .button { position:absolute; right:0; top:0; min-height:36px; padding:6px 10px; }
.profile-theme { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:12px; margin-top:24px; padding:16px; border:1px solid var(--line); border-radius:12px; background:var(--surface); }
.profile-theme-label { font-size:14px; font-weight:700; }

/* Card transitions use a gentle ease-in-out curve and respect reduced motion. */
@media (prefers-reduced-motion: no-preference) {
  .button, .item-card, .tab, .theme-switch span { transition-timing-function: cubic-bezier(.4, 0, .2, 1); }
  .customer-order-toggle::after { transition: transform .28s cubic-bezier(.2, 0, 0, 1); }
}
.catalog-upload-preview { display:block; max-width:100%; max-height:180px; object-fit:contain; border-radius:12px; background:var(--bg); }
.profile-card { display:flex; flex-direction:column; align-items:center; gap:8px; margin-bottom:24px; padding:24px 16px; border:1px solid var(--line); border-radius:16px; background:var(--surface); text-align:center; }
.profile-avatar { width:80px; height:80px; display:grid; place-items:center; overflow:hidden; border-radius:50%; background:var(--accent); color:var(--on-accent); font-size:26px; font-weight:700; }
.profile-avatar img { width:100%; height:100%; object-fit:cover; }
.profile-card .supporting { margin:0; }
.profile-private { width:100%; padding:16px; margin-top:8px; border-radius:12px; background:var(--bg); text-align:left; overflow-wrap:anywhere; }
.profile-private .button { padding-left:0; }
.profile-private p { font-size:14px; }
.admin-queues { display:flex; flex-wrap:wrap; gap:8px; margin-bottom:16px; }
.admin-queues [aria-pressed="true"] { background:var(--accent); color:var(--on-accent); }
.nearest-period { margin:16px 0; padding:16px; border:1px solid var(--line); border-radius:12px; background:var(--surface); }
.nearest-period p { color:var(--muted); font-size:14px; }
.loading-label { margin:0 0 12px; color:var(--muted); font-size:14px; }
.loading-skeleton { display:grid; gap:10px; width:100%; padding:4px 0; }
.loading-skeleton span { display:block; height:52px; border-radius:12px; background:color-mix(in srgb, var(--text) 8%, var(--surface)); }
.loading-skeleton span:nth-child(2) { width:88%; }
.loading-skeleton span:nth-child(3) { width:70%; }
.receipt-preview-skeleton span { height:90px; }
@media (prefers-reduced-motion: no-preference) { .loading-skeleton span { animation: skeleton-pulse 1.4s ease-in-out infinite alternate; } @keyframes skeleton-pulse { from { opacity:.55; } to { opacity:1; } } }

/* Keep pickup and return visible together without two mostly empty full-width rows. */
.dates-view .date-grid {
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:12px;
  max-width:850px;
  margin-bottom:12px;
  padding:0;
  background:transparent;
}
.dates-view .date-grid .field,
.dates-view .date-grid .field + .field {
  min-width:0;
  padding:12px 14px;
  border:1px solid var(--line);
  border-radius:var(--card-radius);
  background:var(--surface);
}
.dates-view .date-grid .field > span {
  min-width:0;
  color:var(--muted);
  font-size:13px;
  line-height:20px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.dates-view .date-grid input:is([type=time], .keyboard-time) {
  width:100%;
  max-width:none;
  height:40px;
  min-height:40px;
  padding:4px 0 0;
  border:0;
  font-size:18px;
  font-weight:700;
}
.dates-view .date-grid input:is([type=time], .keyboard-time):disabled { opacity:.55; }
.dates-view .period-row { min-height:32px; }
.dates-view #start-hint { margin:8px 0 0; }
@media (max-width:359px) {
  .dates-view .date-grid { gap:6px; }
  .dates-view .date-grid .field,
  .dates-view .date-grid .field + .field { padding:10px; }
  .dates-view .date-grid .field > span { font-size:12px; }
  .dates-view .date-grid input:is([type=time], .keyboard-time) { font-size:16px; }
}

/* Calendar selection motion: the button pops while its fill reveals separately. */
.range-calendar .calendar-day {
  position:relative;
  isolation:isolate;
}
.range-calendar .calendar-day.selected,
.range-calendar .calendar-day.in-range { background:transparent; }
.range-calendar .calendar-day::before {
  position:absolute;
  z-index:-1;
  inset:0;
  border-radius:inherit;
  background:transparent;
  content:"";
}
.range-calendar .calendar-day.in-range::before {
  background:color-mix(in srgb, var(--accent) 14%, var(--surface));
}
.range-calendar .calendar-day.selected::before { background:var(--accent); }
@media (prefers-reduced-motion: no-preference) {
  .range-calendar .calendar-day-pop {
    animation:calendar-day-pop 210ms cubic-bezier(.34, 1.56, .64, 1);
    will-change:transform;
  }
  .range-calendar .calendar-day-reveal::before {
    animation:calendar-day-reveal 180ms cubic-bezier(.22, 1, .36, 1) both;
    animation-delay:var(--range-reveal-delay, 110ms);
    will-change:opacity, transform;
  }
  @keyframes calendar-day-pop {
    0% { transform:scale(1); }
    52% { transform:scale(1.16); }
    100% { transform:scale(1); }
  }
  @keyframes calendar-day-reveal {
    from { opacity:0; transform:scale(.58); }
    to { opacity:1; transform:scale(1); }
  }
}
@media (prefers-reduced-motion: reduce) {
  .range-calendar .calendar-day-pop,
  .range-calendar .calendar-day-reveal::before {
    animation:none;
    transition:none;
  }
}

/* Profile: clear hierarchy between identity, booking history and preferences. */
#orders-panel { display:grid; gap:20px; }
.profile-overview {
  display:grid;
  grid-template-columns:minmax(0, .9fr) minmax(0, 1.1fr);
  gap:16px;
}
.profile-card {
  display:grid;
  grid-template-columns:80px minmax(0, 1fr);
  align-items:center;
  gap:18px;
  min-width:0;
  margin:0;
  padding:22px;
  text-align:left;
}
.profile-summary { min-width:0; }
.profile-summary h2 { margin:0 0 6px; font-size:22px; overflow-wrap:anywhere; }
.profile-summary .supporting { margin:2px 0; overflow-wrap:anywhere; }
.profile-private {
  min-width:0;
  margin:0;
  padding:22px;
  border:1px solid var(--line);
  border-radius:16px;
  background:var(--surface);
}
.profile-private > strong { display:block; font-size:16px; }
.profile-private > .supporting { margin:6px 0 16px; }
.profile-private .button { width:100%; padding-left:14px; text-align:left; }
#profile-identity-fields { margin-top:16px; padding-top:8px; border-top:1px solid var(--line); }
#profile-identity-fields p { margin:10px 0 0; font-size:13px; line-height:1.45; }
#profile-identity-fields strong { display:block; color:var(--muted); font-size:12px; }
.profile-history {
  min-width:0;
  padding:22px;
  border-radius:16px;
  background:var(--surface);
}
.profile-history > .panel-head { margin-bottom:18px; }
.profile-toolbar {
  display:grid;
  grid-template-columns:minmax(0, 1.35fr) minmax(0, 1fr) minmax(0, .9fr);
  gap:12px;
  padding-bottom:18px;
  border-bottom:1px solid var(--line);
}
.profile-toolbar form,
.profile-toolbar .field { min-width:0; margin:0; }
.profile-toolbar input,
.profile-toolbar select { min-height:48px; }
#orders-content { display:grid; gap:12px; min-width:0; margin-top:18px; }
#orders-content > .customer-order-card { margin:0; }
#profile-pagination { align-items:center; justify-content:center; margin:18px 0 0; }
#profile-pagination > span { min-width:52px; color:var(--muted); text-align:center; font-size:13px; font-weight:700; }
.profile-preferences {
  display:grid;
  grid-template-columns:minmax(0, 1fr) minmax(0, 1fr);
  gap:16px;
  align-items:start;
}
.profile-theme { min-height:74px; margin:0; border-radius:16px; }
#profile-header { margin:0; border-radius:16px; }
.profile-settings > summary { position:relative; padding-right:26px; list-style:none; color:var(--text); }
.profile-settings > summary::-webkit-details-marker { display:none; }
.profile-settings > summary::after {
  position:absolute;
  right:0;
  content:"›";
  color:var(--accent);
  font-size:22px;
  line-height:1;
  transform:rotate(90deg);
}
.profile-settings[open] > summary::after { transform:rotate(-90deg); }
.profile-settings-actions { display:grid; grid-template-columns:repeat(2, minmax(0, 1fr)); gap:8px; }
.profile-settings-actions .button { min-width:0; }
.profile-settings .check-row { margin-bottom:10px; }
.profile-settings > .supporting { margin:0; font-size:13px; }
@media (max-width:720px) {
  .profile-overview,
  .profile-preferences { grid-template-columns:1fr; }
  .profile-toolbar { grid-template-columns:repeat(2, minmax(0, 1fr)); }
  .profile-toolbar form { grid-column:1 / -1; }
}
@media (max-width:420px) {
  #orders-panel { gap:14px; }
  .profile-card { grid-template-columns:64px minmax(0, 1fr); gap:14px; padding:18px; }
  .profile-avatar { width:64px; height:64px; }
  .profile-summary h2 { font-size:19px; }
  .profile-private,
  .profile-history { padding:18px; }
  .profile-toolbar { grid-template-columns:1fr; }
  .profile-toolbar form { grid-column:auto; }
  .profile-settings-actions { grid-template-columns:1fr; }
  .profile-theme { align-items:flex-start; }
  .profile-theme-label { flex-basis:100%; }
}

#orders-panel[hidden] { display:none; }

.nearest-period { margin:16px 0; padding:16px; border:1px solid var(--line); border-radius:12px; background:var(--surface); }
.nearest-period p { color:var(--muted); font-size:14px; }
.loading-label { margin:0 0 12px; color:var(--muted); font-size:14px; }
.loading-skeleton { display:grid; gap:10px; width:100%; padding:4px 0; }
.loading-skeleton span { display:block; height:52px; border-radius:12px; background:color-mix(in srgb, var(--text) 8%, var(--surface)); }
.loading-skeleton span:nth-child(2) { width:88%; }
.loading-skeleton span:nth-child(3) { width:70%; }
.receipt-preview-skeleton span { height:90px; }
@media (prefers-reduced-motion: no-preference) { .loading-skeleton span { animation: skeleton-pulse 1.4s ease-in-out infinite alternate; } @keyframes skeleton-pulse { from { opacity:.55; } to { opacity:1; } } }

/* Keep pickup and return visible together without two mostly empty full-width rows. */
.dates-view .date-grid {
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:12px;
  max-width:850px;
  margin-bottom:12px;
  padding:0;
  background:transparent;
}
.dates-view .date-grid .field,
.dates-view .date-grid .field + .field {
  min-width:0;
  padding:12px 14px;
  border:1px solid var(--line);
  border-radius:var(--card-radius);
  background:var(--surface);
}
.dates-view .date-grid .field > span {
  min-width:0;
  color:var(--muted);
  font-size:13px;
  line-height:20px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.dates-view .date-grid input:is([type=time], .keyboard-time) {
  width:100%;
  max-width:none;
  height:40px;
  min-height:40px;
  padding:4px 0 0;
  border:0;
  font-size:18px;
  font-weight:700;
}
.dates-view .date-grid input:is([type=time], .keyboard-time):disabled { opacity:.55; }
.dates-view .period-row { min-height:32px; }
.dates-view #start-hint { margin:8px 0 0; }
@media (max-width:359px) {
  .dates-view .date-grid { gap:6px; }
  .dates-view .date-grid .field,
  .dates-view .date-grid .field + .field { padding:10px; }
  .dates-view .date-grid .field > span { font-size:12px; }
  .dates-view .date-grid input:is([type=time], .keyboard-time) { font-size:16px; }
}

/* Calendar selection motion: the button pops while its fill reveals separately. */
.range-calendar .calendar-day {
  position:relative;
  isolation:isolate;
}
.range-calendar .calendar-day.selected,
.range-calendar .calendar-day.in-range { background:transparent; }
.range-calendar .calendar-day::before {
  position:absolute;
  z-index:-1;
  inset:0;
  border-radius:inherit;
  background:transparent;
  content:"";
}
.range-calendar .calendar-day.in-range::before {
  background:color-mix(in srgb, var(--accent) 14%, var(--surface));
}
.range-calendar .calendar-day.selected::before { background:var(--accent); }
@media (prefers-reduced-motion: no-preference) {
  .range-calendar .calendar-day-pop {
    animation:calendar-day-pop 210ms cubic-bezier(.34, 1.56, .64, 1);
    will-change:transform;
  }
  .range-calendar .calendar-day-reveal::before {
    animation:calendar-day-reveal 180ms cubic-bezier(.22, 1, .36, 1) both;
    animation-delay:var(--range-reveal-delay, 110ms);
    will-change:opacity, transform;
  }
  @keyframes calendar-day-pop {
    0% { transform:scale(1); }
    52% { transform:scale(1.16); }
    100% { transform:scale(1); }
  }
  @keyframes calendar-day-reveal {
    from { opacity:0; transform:scale(.58); }
    to { opacity:1; transform:scale(1); }
  }
}
@media (prefers-reduced-motion: reduce) {
  .range-calendar .calendar-day-pop,
  .range-calendar .calendar-day-reveal::before {
    animation:none;
    transition:none;
  }
}

/* Profile: clear hierarchy between identity, booking history and preferences. */
#orders-panel { display:grid; gap:20px; }
.profile-overview {
  display:grid;
  grid-template-columns:minmax(0, .9fr) minmax(0, 1.1fr);
  gap:16px;
}
.profile-card {
  display:grid;
  grid-template-columns:80px minmax(0, 1fr);
  align-items:center;
  gap:18px;
  min-width:0;
  margin:0;
  padding:22px;
  text-align:left;
}
.profile-summary { min-width:0; }
.profile-summary h2 { margin:0 0 6px; font-size:22px; overflow-wrap:anywhere; }
.profile-summary .supporting { margin:2px 0; overflow-wrap:anywhere; }
.profile-private {
  min-width:0;
  margin:0;
  padding:22px;
  border:1px solid var(--line);
  border-radius:16px;
  background:var(--surface);
}
.profile-private > strong { display:block; font-size:16px; }
.profile-private > .supporting { margin:6px 0 16px; }
.profile-private .button { width:100%; padding-left:14px; text-align:left; }
#profile-identity-fields { margin-top:16px; padding-top:8px; border-top:1px solid var(--line); }
#profile-identity-fields p { margin:10px 0 0; font-size:13px; line-height:1.45; }
#profile-identity-fields strong { display:block; color:var(--muted); font-size:12px; }
.profile-history {
  min-width:0;
  padding:22px;
  border-radius:16px;
  background:var(--surface);
}
.profile-history > .panel-head { margin-bottom:18px; }
.profile-toolbar {
  display:grid;
  grid-template-columns:minmax(0, 1.35fr) minmax(0, 1fr) minmax(0, .9fr);
  gap:12px;
  padding-bottom:18px;
  border-bottom:1px solid var(--line);
}
.profile-toolbar form,
.profile-toolbar .field { min-width:0; margin:0; }
.profile-toolbar input,
.profile-toolbar select { min-height:48px; }
#orders-content { display:grid; gap:12px; min-width:0; margin-top:18px; }
#orders-content > .customer-order-card { margin:0; }
#profile-pagination { align-items:center; justify-content:center; margin:18px 0 0; }
#profile-pagination > span { min-width:52px; color:var(--muted); text-align:center; font-size:13px; font-weight:700; }
.profile-preferences {
  display:grid;
  grid-template-columns:minmax(0, 1fr) minmax(0, 1fr);
  gap:16px;
  align-items:start;
}
.profile-theme { min-height:74px; margin:0; border-radius:16px; }
#profile-header { margin:0; border-radius:16px; }
.profile-settings > summary { position:relative; padding-right:26px; list-style:none; color:var(--text); }
.profile-settings > summary::-webkit-details-marker { display:none; }
.profile-settings > summary::after {
  position:absolute;
  right:0;
  content:"›";
  color:var(--accent);
  font-size:22px;
  line-height:1;
  transform:rotate(90deg);
}
.profile-settings[open] > summary::after { transform:rotate(-90deg); }
.profile-settings-actions { display:grid; grid-template-columns:repeat(2, minmax(0, 1fr)); gap:8px; }
.profile-settings-actions .button { min-width:0; }
.profile-settings .check-row { margin-bottom:10px; }
.profile-settings > .supporting { margin:0; font-size:13px; }
@media (max-width:720px) {
  .profile-overview,
  .profile-preferences { grid-template-columns:1fr; }
  .profile-toolbar { grid-template-columns:repeat(2, minmax(0, 1fr)); }
  .profile-toolbar form { grid-column:1 / -1; }
}
@media (max-width:420px) {
  #orders-panel { gap:14px; }
  .profile-card { grid-template-columns:64px minmax(0, 1fr); gap:14px; padding:18px; }
  .profile-avatar { width:64px; height:64px; }
  .profile-summary h2 { font-size:19px; }
  .profile-private,
  .profile-history { padding:18px; }
  .profile-toolbar { grid-template-columns:1fr; }
  .profile-toolbar form { grid-column:auto; }
  .profile-settings-actions { grid-template-columns:1fr; }
  .profile-theme { align-items:flex-start; }
  .profile-theme-label { flex-basis:100%; }
}

/* Visual editor updates + compact header placement for #admin-settings > summary */
#mode-banner { display:none !important; }
#admin-panel { position:relative; }
.panel-head,
#admin-panel > .panel-head {
  padding:0;
  flex-wrap:nowrap;
}
.admin-tabs {
  display:flex;
  flex-wrap:nowrap;
  align-items:center;
  gap:6px;
  padding-top:4px;
  padding-bottom:4px;
  overflow-x:auto;
  scrollbar-width:none;
}
.admin-tabs::-webkit-scrollbar { display:none; }
.admin-tabs > .button,
.admin-tabs > .admin-mode,
.admin-tabs > .admin-mode:not(:disabled):hover {
  flex:1 1 auto;
  min-width:max-content;
  padding:0 4px;
  font-size:13.5px;
  font-weight:400;
  opacity:.52;
  white-space:nowrap;
  transform:scale(var(--tab-scale, 1));
  transform-origin:center bottom;
  transition:transform .16s cubic-bezier(.22, 1, .36, 1), opacity .2s ease, font-size .2s ease, font-weight .2s ease, color .2s ease;
}
.admin-tabs > .admin-mode[aria-pressed="true"],
.admin-tabs > .admin-mode[aria-pressed="true"]:not(:disabled):hover {
  padding:0 4px;
  font-size:16px;
  font-weight:700;
  opacity:1;
  color:var(--accent);
}
.admin-tabs > .admin-mode:not([aria-pressed="true"]):hover {
  --tab-scale:1.09;
  opacity:.88;
}
.admin-tabs > .admin-mode[aria-pressed="true"]:hover {
  --tab-scale:1.09;
}
.admin-tabs:has(> .admin-mode:hover) > .admin-mode:not(:hover):not([aria-pressed="true"]),
.admin-tabs:has(> .admin-mode:active) > .admin-mode:not(:active) {
  opacity:.38;
}
#admin-settings { margin:0; }
#admin-settings[open] {
  margin:0 0 16px;
  padding:12px;
  border:1px solid var(--line);
  border-radius:var(--card-radius);
  background:var(--surface);
}
#admin-settings > summary {
  position:absolute;
  top:-2px;
  right:0;
  min-height:34px;
  padding:6px 12px;
  border:1px solid var(--line);
  border-radius:999px;
  background:var(--surface);
  color:var(--text);
  font-size:13px;
  font-weight:600;
  line-height:1.2;
  list-style:none;
}
#admin-settings > summary::-webkit-details-marker { display:none; }
#admin-settings > summary::before {
  margin-right:6px;
  color:var(--accent);
}
#admin-settings[open] > summary {
  border-color:var(--accent);
  background:var(--soft);
  color:var(--accent);
}
#admin-request-filter-field > span,
#admin-status-field > span,
#admin-sort-field > span {
  height:22px;
  padding:0;
  font-size:18px;
  font-weight:700;
}
#admin-request-filter-field > span { border-radius:0; }
#admin-request-filter,
#admin-status,
#admin-sort {
  width:100%;
  height:16px;
  min-height:35px;
  padding:2px 10px;
  border-width:1px;
  border-radius:79px;
  border-style:none;
  border-color:rgb(0, 0, 0);
}
.request-card,
.customer-order-card {
  border:1px solid var(--line);
  border-radius:16px;
  background:var(--surface);
  box-shadow:0 4px 18px color-mix(in srgb, var(--text) 4%, transparent);
}
.request-toggle,
.customer-order-toggle {
  min-height:0;
  gap:6px;
  padding:12px 40px 12px 14px;
  border-radius:16px;
}
.request-toggle .order-head,
.customer-order-toggle .order-head {
  display:flex;
  align-items:center;
  flex-wrap:nowrap;
  gap:8px;
  min-width:0;
}
.request-toggle .order-head strong,
.customer-order-toggle .order-head strong {
  font-size:25px;
  font-weight:700;
  line-height:1.15;
  letter-spacing:-.02em;
  white-space:nowrap;
}
.customer-order-toggle .order-head strong {
  font-size:19px;
}
.request-toggle .status-pill,
.customer-order-toggle .status-pill {
  flex-shrink:0;
  padding:5px 11px;
  font-size:14px;
  font-weight:700;
  white-space:nowrap;
}
.customer-order-toggle .status-pill {
  font-size:13px;
}
.request-client {
  margin-top:2px;
  color:var(--text);
  font-size:16px;
  font-weight:600;
  line-height:1.35;
}
.request-accordion:not([open]) .request-client {
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.request-period,
.customer-order-period {
  display:inline-flex;
  align-items:center;
  width:fit-content;
  max-width:100%;
  padding:5px 10px;
  border-radius:8px;
  background:var(--soft);
  color:var(--text);
  font-size:13px;
  font-weight:600;
  font-variant-numeric:tabular-nums;
  line-height:1.35;
  white-space:nowrap;
}
.request-accordion:not([open]) .request-assignee,
.request-accordion:not([open]) .request-sla {
  display:none !important;
}
.request-assignee,
.customer-order-items {
  margin-top:4px;
  padding-top:10px;
  border-top:1px solid var(--line);
  color:var(--muted);
  font-size:13px;
  font-weight:500;
  line-height:1.35;
}
.request-sla {
  color:var(--muted);
  font-size:12.5px;
  line-height:1.35;
}
.request-sla-overdue {
  display:grid;
  gap:4px;
  width:100%;
  max-width:100%;
  margin-top:4px;
  padding:8px 12px;
  border:1px solid color-mix(in srgb, var(--danger) 35%, transparent);
  border-radius:10px;
  background:color-mix(in srgb, var(--danger) 12%, var(--surface));
  color:var(--danger);
  font-size:13px;
  font-weight:700;
}
.request-sla-overdue .request-sla-alert {
  display:inline-flex;
  align-items:center;
  width:fit-content;
  padding:3px 8px;
  border-radius:6px;
  background:var(--danger);
  color:#fff;
  font-size:12px;
  font-weight:800;
  line-height:1.2;
  letter-spacing:.04em;
  text-transform:uppercase;
}
.request-next-overview.request-actions {
  display:grid;
  gap:10px;
  margin-top:16px;
  padding:16px;
  border:1px solid var(--line);
  border-radius:14px;
  background:var(--soft);
}
.request-next-head {
  display:flex;
  align-items:center;
  justify-content:space-between;
  flex-wrap:wrap;
  gap:8px;
}
.request-next-head h4 {
  margin:0;
  font-size:16px;
  font-weight:700;
}
.request-next-head .stage-lock {
  margin:0;
  padding:4px 10px;
  border:1px solid var(--line);
  border-radius:999px;
  background:var(--surface);
  color:var(--muted);
  font-size:12px;
  font-weight:600;
  line-height:1.3;
}
.request-primary-actions {
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin:2px 0 0;
}
.request-primary-actions > .workflow-next {
  width:100%;
  min-height:46px;
  margin:0;
  padding:12px 16px;
  border:0;
  justify-content:center;
  text-align:center;
  font-size:15px;
  font-weight:700;
  box-shadow:none;
}
.request-primary-actions > .workflow-next::after { display:none; }
.request-more-actions {
  margin-top:2px;
  padding-top:10px;
  border-top:1px solid var(--line);
}
.request-more-actions > summary {
  display:inline-flex;
  align-items:center;
  gap:6px;
  min-height:34px;
  padding:6px 12px;
  border:1px solid var(--line);
  border-radius:999px;
  background:var(--surface);
  color:var(--text);
  font-size:13px;
  font-weight:600;
  line-height:1.2;
  cursor:pointer;
  list-style:none;
}
.request-more-actions > summary::-webkit-details-marker { display:none; }
.request-more-actions > summary::after {
  content:"▾";
  color:var(--muted);
  font-size:12px;
  transition:transform .2s;
}
.request-more-actions[open] > summary {
  border-color:var(--accent);
  color:var(--accent);
}
.request-more-actions[open] > summary::after {
  transform:rotate(180deg);
  color:var(--accent);
}
.request-more-body {
  display:grid;
  gap:10px;
  margin-top:10px;
}
.request-secondary-grid {
  display:grid;
  grid-template-columns:repeat(auto-fit, minmax(180px, 1fr));
  gap:8px;
}
.request-secondary-grid > .button {
  width:100%;
  min-height:40px;
  margin:0;
  padding:8px 12px;
  justify-content:center;
  text-align:center;
  font-size:13px;
}
.request-danger-zone {
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  padding-top:10px;
  border-top:1px dashed var(--line);
}
.request-danger-zone > .button.danger {
  flex:1 1 140px;
  width:auto;
  min-height:38px;
  margin:0;
  padding:8px 12px;
  border:1px solid color-mix(in srgb, var(--danger) 30%, var(--line));
  background:var(--surface);
  justify-content:center;
  text-align:center;
  font-size:13px;
}
.request-equipment {
  display:grid;
  gap:8px;
  margin-top:12px;
}
.request-equipment-row,
.inspection-row {
  display:grid;
  grid-template-columns:1fr;
  gap:0;
  padding:7px 10px;
  border:1px solid var(--line);
  border-radius:12px;
  background:var(--surface);
  transition:border-color .22s ease, background-color .22s ease, box-shadow .22s ease;
}
.inspection-row {
  background:var(--soft);
}
.request-equipment-row.is-expandable,
.inspection-row.is-expandable {
  cursor:pointer;
}
.request-equipment-row.equipment-change-added,
.request-equipment-row.equipment-change-removed,
.request-equipment-row.equipment-change-updated,
.rental-period.equipment-change-updated {
  position:relative;
  background:color-mix(in srgb, var(--change-color) 15%, var(--surface));
  border:1px solid color-mix(in srgb, var(--change-color) 55%, var(--line));
  cursor:pointer;
}
.equipment-change-added { --change-color:#228b59; }
.equipment-change-removed { --change-color:#d14747; }
.equipment-change-updated { --change-color:#c48a16; }
.rental-period.equipment-change-updated { padding:8px; border-radius:10px; }
.equipment-change-marker { position:absolute; right:5px; top:3px; font-size:12px; font-weight:700; line-height:1; pointer-events:none; }
.request-equipment-row[class*="equipment-change-"]:focus-visible,
.rental-period.equipment-change-updated:focus-visible { outline:2px solid var(--accent); outline-offset:3px; }
.request-equipment-row[class*="equipment-change-"] > strong { padding-right:14px; overflow-wrap:anywhere; }
.change-details .request-equipment-row { gap:6px; padding:12px; cursor:default; }
.request-equipment-row.is-expanded,
.inspection-row.is-expanded {
  border-color:color-mix(in srgb, var(--accent) 45%, var(--line));
  box-shadow:0 4px 14px color-mix(in srgb, var(--text) 6%, transparent);
}
.equipment-card-main {
  display:grid;
  grid-template-columns:42px minmax(0, 1fr) auto;
  align-items:center;
  gap:10px;
  width:100%;
  min-width:0;
}
.request-equipment-thumb {
  width:42px;
  height:42px;
  border-radius:10px;
  overflow:hidden;
  background:var(--soft);
  border:1px solid var(--line);
  flex-shrink:0;
}
.request-item-photo,
.request-item-placeholder {
  width:100%;
  height:100%;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:2px;
  object-fit:cover;
  color:var(--accent);
  text-align:center;
}
.request-item-placeholder .placeholder-icon {
  width:20px;
  height:20px;
}
.request-item-placeholder small {
  display:none;
}
.request-equipment-info {
  display:flex;
  align-items:center;
  align-self:center;
  gap:6px;
  min-width:0;
}
.request-equipment-title {
  color:var(--text);
  font-size:14px;
  font-weight:700;
  line-height:1.25;
  overflow-wrap:anywhere;
}
.request-equipment-full {
  flex-basis:auto;
  color:var(--text);
  font-size:12.5px;
  font-weight:600;
  line-height:1.3;
  overflow-wrap:anywhere;
}
.request-equipment-desc {
  color:var(--muted);
  font-size:12px;
  line-height:1.3;
  overflow-wrap:anywhere;
}
.request-card .request-equipment-remove {
  align-self:center;
  display:inline-grid;
  place-items:center;
  width:32px;
  height:32px;
  min-width:32px;
  min-height:32px;
  margin:0;
  padding:0;
  border-radius:8px;
  font-size:18px;
  line-height:1;
}
.equipment-card-drawer {
  display:grid;
  grid-template-rows:0fr;
  opacity:0;
  transition:grid-template-rows .26s cubic-bezier(.4, 0, .2, 1), opacity .2s ease, margin-top .26s cubic-bezier(.4, 0, .2, 1);
}
.is-expanded > .equipment-card-drawer {
  grid-template-rows:1fr;
  opacity:1;
  margin-top:8px;
}
.equipment-card-drawer-inner {
  overflow:hidden;
  display:grid;
  gap:4px;
  padding-top:0;
  border-top:1px solid transparent;
  transition:padding-top .26s cubic-bezier(.4, 0, .2, 1), border-color .2s ease;
}
.is-expanded > .equipment-card-drawer > .equipment-card-drawer-inner {
  padding-top:8px;
  border-top-color:var(--line);
}
.request-service {
  padding:14px 16px;
  margin-top:12px;
  border:1px dashed var(--line);
  border-radius:12px;
  background:var(--soft);
}
.request-service h4 {
  margin:0 0 6px;
  color:var(--muted);
  font-size:13px;
  font-weight:700;
  text-transform:uppercase;
  letter-spacing:.03em;
}
.request-service .request-test-flag {
  margin:0;
  min-height:32px;
}
/* Compact inspection cards & request body sections */
.request-body .request-section {
  padding:12px 0;
}
.request-body .request-section h4 {
  margin:0 0 8px;
  font-size:15px;
}
.request-body .request-fields {
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:8px 12px;
}
.request-body .request-fields dt {
  color:var(--muted);
  font-size:11.5px;
}
.request-body .request-fields dd {
  margin-top:2px;
  font-size:13.5px;
}
.request-summary > p {
  margin:6px 0 4px;
  font-size:12.5px;
}
.request-summary > progress {
  width:100%;
  height:6px;
  border-radius:999px;
  overflow:hidden;
}
.request-summary .asset-list {
  display:grid;
  gap:6px;
  margin:8px 0 0;
  padding:0;
  list-style:none;
}
.request-summary .asset-list li {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  padding:6px 10px;
  border-radius:10px;
  background:var(--soft);
  font-size:12.5px;
}
.inspection-group {
  display:grid;
  gap:8px;
  width:100%;
  margin-top:4px;
  padding:12px;
  border:1px solid var(--line);
  border-radius:14px;
  background:var(--surface);
}
.inspection-group-head {
  display:flex;
  align-items:center;
  justify-content:space-between;
  flex-wrap:wrap;
  gap:8px;
}
.inspection-group-title {
  margin:0;
  font-size:14px;
  font-weight:700;
}
.inspection-progress {
  margin:0;
  padding:2px 8px;
  border-radius:999px;
  background:var(--soft);
  color:var(--muted);
  font-size:12px;
  font-weight:600;
}
.inspection-unit-thumb {
  width:42px;
  height:42px;
  border-radius:10px;
  background:var(--surface);
}
.inspection-unit {
  display:flex;
  flex-direction:column;
  justify-content:center;
  gap:2px;
  min-width:0;
}
.inspection-unit-head {
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  gap:3px;
  min-width:0;
}
.inspection-unit-name {
  width:100%;
  font-size:13.5px;
  font-weight:700;
  line-height:1.25;
  overflow-wrap:anywhere;
}
.inspection-state {
  flex-shrink:0;
  width:fit-content;
  margin:0;
  padding:2px 7px;
  border-radius:999px;
  background:var(--surface);
  font-size:11px;
  font-weight:600;
  line-height:1.2;
  white-space:nowrap;
}
.inspection-state.checked {
  background:color-mix(in srgb, var(--success, #16835b) 14%, var(--surface));
  color:var(--success, #16835b);
}
.inspection-unit-meta {
  color:var(--muted);
  font-size:11.5px;
  line-height:1.25;
}
.inspection-components {
  display:flex;
  flex-wrap:wrap;
  gap:3px 8px;
  margin:0;
  padding:0;
  list-style:none;
  color:var(--muted);
  font-size:11.5px;
  line-height:1.25;
}
.inspection-components li + li::before {
  content:"· ";
  margin-right:4px;
}
.inspection-row-actions {
  display:inline-flex;
  align-items:center;
  gap:4px;
  align-self:center;
}
.inspection-row-actions > .inspection-defect-button,
.inspection-row-actions > .request-equipment-remove {
  display:inline-grid;
  place-items:center;
  width:32px;
  height:32px;
  min-width:32px;
  min-height:32px;
  margin:0;
  padding:0;
  border-radius:8px;
  background:var(--surface);
  font-size:18px;
  line-height:1;
}
.inspection-row-actions > .inspection-defect-button .icon {
  width:16px;
  height:16px;
}
.inspection-row.has-inspection-editor {
  border-color:var(--accent);
  background:var(--surface);
}
.inspection-row.has-inspection-editor .inspection-defect-button {
  border-color:var(--accent);
  background:var(--soft);
  color:var(--accent);
}
.inspection-row > .inspection-editor {
  margin:8px 0 2px;
  padding:12px;
  border:1px solid var(--line);
  border-radius:10px;
  background:var(--soft);
  box-shadow:none;
  animation:card-reveal .24s cubic-bezier(.4, 0, .2, 1) both;
}
.inspection-row > .inspection-editor .order-head {
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:8px;
  margin-bottom:8px;
}
.inspection-row > .inspection-editor h3 {
  margin:0;
  font-size:14px;
  line-height:1.25;
}
.inspection-row > .inspection-editor .order-head p {
  margin:2px 0 0;
  font-size:12px;
}
.inspection-row > .inspection-editor .inspection-close {
  min-height:30px;
  padding:4px 10px;
  font-size:12px;
}
.inspection-row > .inspection-editor .field {
  gap:4px;
  margin-bottom:10px;
  font-size:12.5px;
}
.inspection-row > .inspection-editor textarea {
  min-height:60px;
  padding:8px 10px;
  font-size:14px;
}
.inspection-row > .inspection-editor input[type="number"] {
  min-height:38px;
  padding:6px 10px;
  font-size:14px;
}
.inspection-row > .inspection-editor .check-row {
  margin:4px 0 10px;
  min-height:36px;
  font-size:13px;
}
.inspection-row > .inspection-editor .action-row {
  margin:4px 0 0;
}
.inspection-row > .inspection-editor .action-row > .button {
  width:100%;
  min-height:38px;
  padding:8px 12px;
  font-size:13.5px;
}
/* Readable catalog period header (#period-label & #change-dates) */
.catalog-period {
  display:flex;
  align-items:center;
  justify-content:space-between;
  flex-wrap:wrap;
  gap:10px 14px;
  padding:12px 14px;
  border:1px solid var(--line);
  border-radius:14px;
  background:var(--surface);
}
#period-label {
  display:flex;
  flex-direction:column;
  gap:4px;
  margin:0;
  min-width:0;
}
#period-label .period-label-caption {
  color:var(--muted);
  font-size:12px;
  font-weight:600;
  line-height:1.2;
}
#period-label .period-label-value {
  display:inline-flex;
  align-items:center;
  width:fit-content;
  max-width:100%;
  padding:5px 10px;
  border-radius:8px;
  background:var(--soft);
  color:var(--text);
  font-size:14px;
  font-weight:700;
  font-variant-numeric:tabular-nums;
  line-height:1.3;
}
.catalog-period #change-dates {
  min-height:36px;
  padding:7px 12px;
  border:1px solid var(--line);
  border-radius:999px;
  background:var(--soft);
  color:var(--accent);
  font-size:13px;
  font-weight:700;
}
/* Pictogram buttons for catalog layout toggle (#catalog-list, #catalog-grid) */
.catalog-layout {
  display:flex;
  justify-content:flex-end;
  gap:6px;
  margin:0 0 12px;
}
.catalog-layout .catalog-layout-icon {
  display:inline-grid;
  place-items:center;
  width:40px;
  height:40px;
  min-width:40px;
  min-height:40px;
  padding:0;
  border:1px solid var(--line);
  border-radius:10px;
  background:var(--surface);
  color:var(--muted);
}
.catalog-layout .catalog-layout-icon .icon {
  width:18px;
  height:18px;
}
.catalog-layout .catalog-layout-icon[aria-pressed="true"] {
  border-color:var(--accent);
  background:var(--soft);
  color:var(--accent);
}
/* Centered tile cards in .items-grid-tiles */
.items-grid.items-grid-tiles .item-card,
.items-grid.items-grid-tiles .item-card.selected {
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  min-height:230px;
  padding:14px 12px;
  text-align:center;
}
.items-grid.items-grid-tiles .item-card .item-photo,
.items-grid.items-grid-tiles .item-card .item-placeholder {
  width:100%;
  height:108px;
  margin:0 auto;
  border-radius:12px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  text-align:center;
}
.items-grid.items-grid-tiles .item-main {
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:space-between;
  flex:1;
  width:100%;
  gap:10px;
  text-align:center;
}
.items-grid.items-grid-tiles .item-main .item-top,
.items-grid.items-grid-tiles .item-main .item-top > div {
  display:flex;
  flex-direction:column;
  align-items:center;
  width:100%;
  gap:4px;
  text-align:center;
}
.items-grid.items-grid-tiles .quantity-control {
  margin:auto auto 0;
}
/* Floating round cart button */
.floating-cart-button[hidden] {
  display:none !important;
}
.floating-cart-button {
  position:fixed;
  right:max(18px, env(safe-area-inset-right), var(--tg-content-safe-area-inset-right, 0px));
  bottom:calc(124px + max(env(safe-area-inset-bottom), var(--tg-content-safe-area-inset-bottom, 0px)));
  z-index:40;
  display:grid;
  place-items:center;
  width:54px;
  height:54px;
  padding:0;
  border:1px solid color-mix(in srgb, var(--accent) 30%, var(--line));
  border-radius:50%;
  background:var(--accent);
  color:var(--on-accent);
  box-shadow:0 8px 24px color-mix(in srgb, var(--accent) 38%, rgba(0, 0, 0, .24));
  cursor:pointer;
  animation:floating-cart-enter .28s cubic-bezier(.22, 1, .36, 1) both;
  transition:transform .2s cubic-bezier(.22, 1, .36, 1), box-shadow .2s ease, background-color .2s ease;
}
@keyframes floating-cart-enter {
  from {
    opacity:0;
    transform:translateY(10px) scale(.84);
  }
  to {
    opacity:1;
    transform:translateY(0) scale(1);
  }
}
/* Center #step-dates on desktop full-screen */
#step-dates {
  max-width:850px;
  margin-left:auto;
  margin-right:auto;
}
#step-dates > .date-grid,
#step-dates > .range-calendar {
  width:100%;
  margin-left:auto;
  margin-right:auto;
}
@media (min-width: 768px) {
  #step-dates > .panel-head {
    justify-content:center;
    text-align:center;
  }
  #step-dates > .date-instruction,
  #step-dates > .period-row,
  #step-dates > .period-row p,
  #step-dates > .period-error {
    justify-content:center;
    text-align:center;
  }
}
#step-items > .selection-bar {
  display:none !important;
}
/* Spacious layout for profile order cards & buttons (.customer-order-card / .customer-order-body) */
.customer-order-toggle {
  gap:8px;
  padding:15px 44px 15px 16px;
}
.customer-order-body {
  display:grid;
  grid-template-columns:repeat(auto-fit, minmax(175px, 1fr));
  gap:10px;
  padding:14px 16px 16px;
}
.customer-order-body > p,
.customer-order-body > .notice,
.customer-order-body > .contact-editor,
.customer-order-body > .button.primary {
  grid-column:1 / -1;
  margin:0;
}
.customer-order-body > .contact-editor[hidden] {
  display:none !important;
}
.customer-order-body > .button {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:100%;
  min-height:44px;
  margin:0;
  padding:10px 14px;
  text-align:center;
}
.floating-cart-button:hover {
  transform:translateY(-2px) scale(1.04);
}
.floating-cart-button .icon {
  width:24px;
  height:24px;
}
.floating-cart-count {
  position:absolute;
  top:-4px;
  right:-4px;
  display:inline-grid;
  place-items:center;
  min-width:22px;
  height:22px;
  padding:0 6px;
  border:2px solid var(--surface);
  border-radius:999px;
  background:var(--danger);
  color:#fff;
  font-size:12px;
  font-weight:800;
  line-height:1;
  font-variant-numeric:tabular-nums;
}
.inspection-all-pass {
  min-height:38px;
  margin-top:2px;
  padding:8px 12px;
  font-size:13px;
}

/* Preserve an accessible touch target for changing the booking period. */
.catalog-period #change-dates { min-height:44px; }

/* Keep date labels readable on narrow phones and booking forms usable on desktop. */
.dates-view .date-grid .field > span {
  overflow:visible;
  text-overflow:clip;
  white-space:normal;
  overflow-wrap:anywhere;
}
@media (min-width: 1100px) {
  #booking-flow { max-width:850px; margin-inline:auto; }
  .action-bar { width:min(930px, 100%); }
}

/* Catalog cards must accommodate long names on narrow screens. */
.client-categories { grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 10px; }
.client-categories > * { min-width: 0; }
.category-card { min-width: 0; width: 100%; gap: 10px; padding: 12px; line-height: 1.3; }
.category-card, .item-card, .item-card.selected { border: 1px solid transparent; background: color-mix(in srgb, var(--surface) 94%, var(--text)); transition: border-color .2s ease, background-color .2s ease, transform .2s ease; }
.item-card.selected { border-color: var(--accent); }
.catalog-heading-row { display: flex; align-items: center; gap: 8px; }
.catalog-heading-row .catalog-screen-heading { margin: 0; }
.catalog-manage-categories { display: inline-grid; place-items: center; width: 40px; height: 40px; padding: 8px; }
.catalog-manage-categories svg { width: 20px; height: 20px; }
.catalog-manage-categories[aria-pressed="true"] { color: var(--accent); background: var(--soft); }
.category-edit-tile { position: relative; min-width: 0; }
.category-delete { position: absolute; z-index: 1; top: -11px; right: -11px; display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 50%; background: radial-gradient(circle, var(--danger) 0 12px, var(--surface) 12px 14px, transparent 14px); color: #fff; font-family: inherit; font-size: 21px; font-weight: 600; line-height: 1; cursor: pointer; }
.category-delete:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.category-add { justify-content: center; min-height: 64px; border: 1px dashed var(--muted); color: var(--accent); }
.category-card.category-add span:last-child { margin: 0; font-size: 30px; font-weight: 400; line-height: 1; }
@media (prefers-reduced-motion: no-preference) {
  .category-edit-tile .category-card { animation: category-edit-wiggle .28s ease-in-out infinite alternate; }
  .category-edit-tile:nth-child(even) .category-card { animation-direction: alternate-reverse; }
  .category-edit-tile:hover .category-card, .category-edit-tile:focus-within .category-card { animation-play-state: paused; }
  @keyframes category-edit-wiggle { from { transform: rotate(-.45deg); } to { transform: rotate(.45deg); } }
}
@media (hover: hover) and (pointer: fine) {
  .category-card:hover, .item-card:hover { border-color: var(--accent); transform: scale(1.015); }
}
@media (prefers-reduced-motion: reduce) {
  .category-card, .item-card { transition: none; }
  .category-card:hover, .item-card:hover { transform: none; }
}
.category-card-icon { display: grid; flex: 0 0 42px; width: 42px; height: 42px; place-items: center; border-radius: 12px; color: var(--accent); background: var(--soft); }
.category-card .category-card-icon .icon { width: 27px; height: 27px; }
.category-card-name { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; font-size: 14px; }
.category-card .category-card-arrow { flex: none; margin-left: auto; color: var(--muted); font-size: 22px; }
.item-card, .item-main, .item-main .item-top, .item-main .item-top > div, .items-grid-tiles .item-main { min-width: 0; }
.item-name, .item-type, .item-notes, .item-main p, .available-badge, .item-placeholder small { max-width: 100%; white-space: normal; overflow-wrap: anywhere; word-break: normal; }
.items-grid.items-grid-tiles .item-main .item-top > div { min-width: 0; }
@media (max-width: 350px) { .client-categories { grid-template-columns: 1fr; } }

/* Expanding the remaining catalog equipment keeps it in the document flow. */
.catalog-extra-assets > summary { width: fit-content; cursor: pointer; list-style: none; }
.catalog-extra-assets > summary::-webkit-details-marker { display: none; }
.catalog-extra-assets-list { display: grid; gap: 8px; padding-top: 8px; }
@media (prefers-reduced-motion: reduce) {
  .equipment-card-drawer, .equipment-card-drawer-inner { transition: none; }
}
/* Consistent, readable controls in the staff workspace. */
#admin-request-filter-field, #admin-status-field, #admin-sort-field { min-width: 0; gap: 7px; margin: 0 0 14px; }
#admin-request-filter-field > span, #admin-status-field > span, #admin-sort-field > span { height: auto; color: var(--text); font-size: 14px; font-weight: 700; line-height: 1.35; }
#admin-request-filter, #admin-status, #admin-sort, .catalog-controls select, .catalog-controls input { width: 100%; min-width: 0; min-height: 50px; height: auto; padding: 12px 38px 12px 14px; border: 1px solid var(--line); border-radius: 12px; background-color: var(--surface); color: var(--text); font-size: 16px; line-height: 1.35; }
#admin-settings > summary { position: static; display: flex; width: fit-content; align-items: center; min-height: 44px; }
#admin-settings { margin: 0 0 16px; }
#admin-settings[open] { margin: 0 0 16px; }
.admin-categories { margin: 16px 0; }
.admin-categories .button { justify-self: start; }
.article-card, .article-main, .article-card-head, .article-card-head .order-head > div { min-width: 0; }
.article-main h3, .article-meta, .article-type, .equipment-row strong, .equipment-row small { overflow-wrap: anywhere; }
.article-card-head .order-head { flex-wrap: wrap; gap: 8px; }
@media (prefers-reduced-motion: reduce) {
  .request-equipment-row, .inspection-row, .customer-order-toggle::after { transition: none; }
}
#admin-settings, #admin-settings[open] { padding: 0; border: 0; background: transparent; }

/* Leave room around the focused disclosure when it is brought into view. */
details, .request-equipment-row.is-expandable, .inspection-row.is-expandable { scroll-margin-block: 16px; }
/* Keep catalog navigation legible and keyboard focus visible on each screen. */
#catalog-page-title, .catalog-screen-heading { scroll-margin-top: 16px; overflow-wrap: anywhere; }
#catalog-page-title:focus-visible, .catalog-screen-heading:focus-visible { outline: 3px solid var(--accent); outline-offset: 5px; border-radius: 4px; }
.catalog-screen-heading { margin: 18px 0 8px; font-size: 20px; line-height: 1.3; }
.client-categories > .button { min-height: 44px; justify-self: start; }
.category-card { min-height: 64px; }

.profile-identity-actions {display:flex;gap:8px;align-items:stretch} .profile-identity-actions .button {flex:1;transition:flex .25s ease,opacity .25s ease} .profile-identity-actions .button[hidden] {display:none} .profile-identity-actions .button:not([hidden]) {animation:profile-action-in .25s ease} @keyframes profile-action-in {from {opacity:0;transform:translateX(-8px)} to {opacity:1;transform:translateX(0)}}
.handover-progress li {display:flex;align-items:center;gap:8px} .handover-progress li>span:first-of-type {flex:1} .handover-badge {font-size:12px;font-weight:700;border-radius:8px;padding:4px 8px} .handover-badge.done {background:#dcfce7;color:#166534} .handover-badge.waiting {background:#fef3c7;color:#92400e} .handover-progress input {accent-color:#238653} .request-equipment-info {flex:1} .request-equipment-quantity {margin-left:auto;font-weight:700} /* Catalog quantity controls share the same compact form in list and tiles. */
.item-card .quantity-control { display:grid; grid-template-columns:44px 24px 44px; align-items:center; gap:0; width:max-content; max-width:100%; margin-left:auto; border:1px solid var(--line); border-radius:10px; overflow:hidden; }
.item-card .quantity-control .button { min-width:44px; min-height:44px; padding:0; border:0; border-radius:0; }
.item-card .quantity-control .quantity-value { text-align:center; font-size:14px; font-variant-numeric:tabular-nums; }
.items-grid.items-grid-tiles .item-card { padding-left:8px; padding-right:8px; } @media(prefers-reduced-motion:reduce){.profile-identity-actions .button{animation:none!important;transition:none!important}}

.receipt-docx-preview {background:#fff;color:#111;padding:18px;max-height:60vh;overflow:auto;font-family:serif;line-height:1.4} .receipt-docx-preview p {margin:0 0 .6em;white-space:pre-wrap} .receipt-docx-preview table {border-collapse:collapse;width:100%;font-size:13px} .receipt-docx-preview td {border:1px solid #777;padding:4px;vertical-align:top}

/* Status colors remain distinct in both light and dark themes. */
.status-pill.status-pending {background:#fff1c2;color:#744900}
.status-pill.status-needs_changes {background:#ffe4c7;color:#8a3d00}
.status-pill.status-confirmed {background:#dceafe;color:#194ca1}
.status-pill.status-preparing {background:#eee2ff;color:#67319c}
.status-pill.status-ready {background:#daf5e6;color:#08643b}
.status-pill.status-issued {background:#d5f2ef;color:#006761}
.status-pill.status-return_inspection {background:#ffe6d4;color:#8c3c08}
.status-pill.status-returned {background:#dceee0;color:#285f39}
.status-pill.status-cancelled {background:#ffe1e5;color:#9b2034}
.status-pill.status-expired {background:#e9edf1;color:#444e5b}
.request-toggle .order-head, .customer-order-toggle .order-head {justify-content:flex-start; width:fit-content; max-width:100%}
.admin-catalog-items.tiles {display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,320px),1fr)); gap:16px; align-items:start}
.admin-catalog-items.tiles .article-card {margin-top:0; min-width:0; height:100%}
.admin-catalog-layout[hidden] {display:none}
.receipt-preview-dialog .dialog-card {width:min(94vw,900px); max-width:900px; gap:16px}
.receipt-preview-dialog h2 {margin:0; font-size:22px; line-height:1.25}
.receipt-preview-dialog .receipt-docx-preview {box-sizing:border-box; width:100%; max-height:min(65vh,780px); padding:clamp(20px,5vw,48px); background:#fff; color:#1d2730; box-shadow:0 2px 12px #172a381c; border:1px solid #dce2e8; border-radius:8px; font-family:Georgia,serif; font-size:15px; line-height:1.55}
.receipt-preview-dialog .receipt-docx-preview p {margin:0 0 .75em; overflow-wrap:anywhere}
.receipt-preview-dialog .receipt-docx-preview table {table-layout:fixed; margin:14px 0; font-size:14px}
.receipt-preview-dialog .receipt-docx-preview td {overflow-wrap:anywhere; padding:8px; border-color:#b8c2cc}
.receipt-preview-dialog .receipt-download {width:auto; min-width:180px; justify-self:start}
.receipt-preview-dialog .action-row {border-top:1px solid var(--line); padding-top:14px; margin-top:0}
@media(min-width:768px) {
  .request-toggle .order-head {justify-content:flex-start; gap:10px}
  .request-actions .document-button, .request-actions .receipt-download {width:auto; max-width:320px}
  .receipt-preview-dialog .dialog-card {max-height:90vh; overflow:auto}
}
@media(max-width:767px) { .receipt-preview-dialog .receipt-download {width:100%} }
/* Keep full rental dates readable on narrow mobile screens. */
.request-period, .customer-order-period { white-space:normal; overflow-wrap:anywhere; }
@media (max-width: 380px) {
  .request-toggle .order-head, .customer-order-toggle .order-head { flex-wrap:wrap; }
}
/* 0.5.2: compact catalogue cards, stable photos and touch quantity controls. */
.catalog-media { position:relative; overflow:hidden; flex-shrink:0; border-radius:12px; background:var(--soft); }
.catalog-media > img, .catalog-media > div { position:absolute; inset:0; width:100%!important; height:100%!important; margin:0!important; object-fit:contain; }
.catalog-media > img { transition:opacity .18s ease; background:var(--surface); }
.catalog-media > img.catalog-loading { opacity:0; }
.catalog-media > [hidden] { display:none; }
.item-media { width:80px; height:96px; }
.article-media { width:72px; height:80px; }
.review-media, .cart-media { width:72px; height:80px; }
.request-item-media { width:56px; height:56px; }
.items-grid.items-grid-tiles .item-media { width:100%; height:auto; aspect-ratio:4/3; }
.cart-item { display:grid; grid-template-columns:72px minmax(0,1fr); align-items:start; gap:14px; }
.cart-item-main { flex:1; min-width:0; }
.cart-item-main h3 { margin:0 0 12px; overflow-wrap:anywhere; }
#cart-items .quantity-control, #review-content .quantity-control { display:grid; grid-template-columns:44px 32px 44px; gap:0; width:max-content; max-width:100%; align-items:center; justify-content:start; border:1px solid var(--line); border-radius:10px; overflow:hidden; }
#cart-items .quantity-control .button, #review-content .quantity-control .button { min-width:44px; width:44px; min-height:44px; padding:0; margin:0; border:0; border-radius:0; touch-action:manipulation; }
.action-bar.with-clear-cart { display:grid; grid-template-columns:1fr 2fr; }
.action-bar.with-clear-cart .button { width:100%; min-width:0; text-align:center; }
.article-card .article-card-head { display:grid; grid-template-columns:72px minmax(0,1fr) auto; align-items:start; gap:12px; }
.article-card-head h3 { margin:0 0 4px; overflow-wrap:anywhere; }
.article-head-actions { display:flex; flex-direction:column; align-items:flex-end; gap:4px; }
.article-count { font-weight:700; white-space:nowrap; }
.article-card .article-type { margin:0; }
.article-toggle { padding:4px 0; text-align:left; }
.icon-action { width:44px; min-width:44px; height:44px; padding:0!important; font-size:24px; }
.article-collapse { display:grid; grid-template-rows:0fr; opacity:0; transition:grid-template-rows .24s ease, opacity .24s ease; }
.article-collapse.is-open { grid-template-rows:1fr; opacity:1; }
.article-collapse-inner { min-height:0; overflow:clip; }
.equipment-row { align-items:flex-start; flex-wrap:nowrap; }
.equipment-main { flex:1; min-width:0; overflow-wrap:anywhere; }
.equipment-main > strong, .equipment-main > .condition-pill { display:block; width:fit-content; margin-bottom:6px; }
.equipment-icon-actions { display:flex; flex-shrink:0; gap:2px; }
.equipment-details dl { margin:12px 0; }
.equipment-details dt { color:var(--muted); font-size:12px; }
.equipment-details dd { margin:0 0 8px; }
.external-occupancy-badge { display:block; color:var(--text); background:color-mix(in srgb,#c48a16 18%,var(--surface)); border-radius:6px; padding:4px 6px; font-size:12px; margin-bottom:8px; }
.equipment-editor-extras { display:grid; gap:20px; margin-top:24px; }
.equipment-editor-extras form { margin-bottom:16px; }
.composition-text, .item-main .composition-text { white-space:pre-wrap; overflow-wrap:anywhere; }
.client-item-details { margin-top:8px; text-align:left; }
.client-item-details[open] > p { animation:catalog-detail-reveal .2s ease; }
@keyframes catalog-detail-reveal { from { opacity:0; transform:translateY(-4px); } to { opacity:1; transform:translateY(0); } }
.tab-avatar { width:24px; height:24px; position:relative; display:inline-block; overflow:hidden; border-radius:50%; flex-shrink:0; background:var(--soft); }
.tab-avatar img { width:100%; height:100%; object-fit:cover; }
.tab-avatar.avatar-loading img { opacity:0; }
.avatar-placeholder { box-shadow:inset 0 0 0 1px var(--line); }
.avatar-loading::after { content:""; position:absolute; inset:0; background:linear-gradient(100deg,transparent 20%,color-mix(in srgb,var(--text) 12%,transparent) 50%,transparent 80%); transform:translateX(-100%); animation:avatar-light-sweep 1.3s ease-in-out infinite; }
@keyframes avatar-light-sweep { to { transform:translateX(100%); } }
#range-calendar .calendar-availability-all { background:#d7f1e2; color:#145c35; }
#range-calendar .calendar-availability-partial { background:#fff0bd; color:#735000; }
#range-calendar .calendar-availability-none { background:#fbdcde; color:#8d2330; }
#range-calendar .calendar-day[data-availability].selected { outline:2px solid currentColor; outline-offset:-2px; }
#range-calendar .calendar-day[data-availability].in-range { box-shadow:inset 0 -3px currentColor; }
#range-calendar .calendar-day[data-availability]::after { display:none; }
#range-calendar .calendar-day[data-availability]::before { background:transparent; }
@media (prefers-reduced-motion:reduce) { .article-collapse, .catalog-media > img { transition:none; } .avatar-loading::after, .client-item-details[open] > p { animation:none; } }

.dates-view .date-grid .keyboard-time { width:100%; max-width:220px; font-variant-numeric:tabular-nums; }
.booking-time-hint { color:var(--muted); font-size:12px; line-height:1.4; }
