/* Shared structural wrappers are transparent on the existing mobile layout. */
.settings-space-layout,.settings-space-rail,.settings-hours-layout{display:contents}.settings-space-nav{display:none}
@media(min-width:761px){
  /* The directory reads as a list of people, with clear secondary metadata. */
  #customersPanel{max-width:1400px}
  .customer-toolbar{gap:10px;margin:0 0 4px;align-items:end}
  .customer-toolbar>label:first-child{max-width:680px}.customer-toolbar>label:nth-child(2){min-width:190px;margin-left:auto}
  .customer-toolbar :is(input,select){height:44px;font-size:14px}
  .customer-toolbar>.primary{height:44px;padding-inline:18px}
  .customer-list-summary{margin:0 0 4px!important;min-height:36px}
  .customer-list-summary p{font-size:12px}
  .staff-page .customer-list-summary .customer-import{min-height:36px;padding:6px 10px;font-size:12px;border-color:transparent;color:var(--muted)}
  .customer-list-summary .customer-import:hover{color:var(--ink);background:var(--surface-raised)}
  .customer-table-wrap{border-radius:10px}
  .customer-table{table-layout:fixed}
  .customer-table th:nth-child(1){width:29%}.customer-table th:nth-child(2){width:25%}.customer-table th:nth-child(3){width:18%}.customer-table th:nth-child(4){width:10%}.customer-table th:nth-child(5){width:18%}
  .customer-table th{font-size:11px;font-weight:500;line-height:1.4}
  .customer-table th,.customer-table td{padding:10px 12px;overflow-wrap:anywhere}
  .customer-table td{font-size:13px;line-height:1.45}
  .customer-list-row{cursor:pointer;transition:background-color .12s}
  .customer-list-row:hover,.customer-list-row:focus-within{background:var(--surface-raised)}
  .customer-list-row:last-child td{border-bottom:0}
  .customer-list-identity>.customer-name{min-height:34px;font-size:14px;font-weight:500;line-height:1.4;text-decoration:none}
  .customer-list-identity>.customer-name:hover{text-decoration:underline;text-underline-offset:3px}
  .customer-list-name .customer-flags{font-size:11px;margin-top:1px}.customer-list-contact small{font-size:11px;color:var(--muted);margin-top:3px}
  .customer-list-next,.customer-list-last{font-variant-numeric:tabular-nums}
  .customer-list-count>a{display:inline-flex;justify-content:center;align-items:center;min-width:36px;min-height:36px;padding:4px 8px;border-radius:7px;font-size:14px;background:var(--surface-inset);text-decoration:none}
  .customer-list-count>a:hover{text-decoration:underline;background:var(--selected)}
  .staff-page .customer-note-indicator{width:34px;height:34px;min-height:34px;padding:8px;border:0;background:transparent}

  /* Key contacts, internal notes and recent visits fit a laptop viewport. */
  .customer-back{min-height:32px;margin:0 0 8px;padding:4px 0;font-size:12px}
  .customer-profile-header{gap:16px;margin-bottom:14px;align-items:center}
  .customer-identity{flex:1;min-width:220px}.customer-identity h2{font-size:22px;line-height:1.3}
  .customer-header-tools{flex-shrink:0;gap:7px}.customer-header-tools button{min-height:40px;padding:8px 12px}
  .customer-more summary{min-height:40px;border-radius:7px;padding:9px 11px}
  .customer-more>div{min-width:210px;padding:6px;gap:3px;border-radius:9px}
  .customer-more>div button{min-height:40px;font-size:13px;border-color:transparent}
  .customer-profile{grid-template-columns:272px minmax(0,1fr);gap:14px;max-width:1200px}
  .customer-sidebar{gap:10px}.customer-card,.customer-history{padding:14px;border-radius:10px}
  .customer-card h3,.customer-history h3{font-size:15px}.customer-section-heading{margin-bottom:0}
  .customer-contact-row{padding:8px 0;gap:3px}.customer-contact-row>a,.customer-contact-row>span{font-size:14px;line-height:1.45}
  .customer-contact-label{font-size:11px}.customer-contact-label small{font-size:10px;padding:2px 5px}
  .customer-note-card p{margin:6px 0;font-size:13px;line-height:1.55}.customer-card .customer-name{min-height:32px}
  .customer-booking-stats{grid-template-columns:repeat(4,minmax(0,1fr));gap:7px;margin-bottom:8px}
  .customer-stat{min-height:52px;padding:8px 10px;display:flex;flex-direction:row;align-items:center;gap:9px;border-radius:7px}
  .customer-stat strong{font-size:22px;line-height:1.2}.customer-stat span{font-size:11px;line-height:1.4}
  .customer-history .customer-booking{padding:10px 0;gap:16px;min-height:66px}
  .customer-booking-open strong{font-size:14px;text-decoration:none}.customer-booking-open:hover strong{text-decoration:underline}
  .customer-booking-open small{font-size:12px}.customer-booking-result{gap:5px}.customer-booking-result>strong{font-size:14px}
  .customer-profile~.customer-legacy{margin-top:10px;border-radius:9px;padding:0 14px;font-size:12px}
  .customer-legacy>summary{display:flex;align-items:center;gap:7px;min-height:42px;cursor:pointer}
  .customer-legacy>summary::before{content:'›';font-size:18px}.customer-legacy[open]>summary::before{transform:rotate(90deg)}
  .customer-legacy dl{gap:8px 18px}.customer-legacy h3{font-size:14px;overflow-wrap:anywhere}
  #customersPanel[data-customer-view=imports]{max-width:1100px}
  #customersPanel[data-customer-view=imports]>button:not(.customer-back){display:block;min-height:46px;margin:8px 0;padding:10px 14px;text-align:left;max-width:100%;font-size:13px}
  #customersPanel[data-customer-view=imports]>.customer-booking{gap:16px;padding:9px 0}.customer-picker-results button{font-size:13px;line-height:1.5;min-height:42px}

  /* Name/contacts stay together; the optional note has a separate reading column. */
  .staff-page dialog.customer-dialog{width:min(650px,calc(100vw - 48px));max-width:650px;max-height:calc(100dvh - 40px);margin:20px auto;padding:20px;border-radius:12px;scroll-padding-block:74px 86px}
  .staff-page dialog.customer-dialog:has(#customerForm){width:min(980px,calc(100vw - 48px));max-width:980px}
  .staff-page .customer-dialog .dialog-top{position:sticky;top:-20px;z-index:3;align-items:center;gap:14px;padding:10px 0;margin:-10px 0 14px;background:var(--surface);border-bottom:1px solid var(--line)}
  .staff-page .customer-dialog .dialog-top h2{font-size:22px;line-height:1.3;margin:0}.staff-page .customer-dialog .dialog-top>button{min-width:40px;min-height:40px;padding:4px;flex-shrink:0;border-radius:8px}
  .customer-form{gap:12px}.staff-page .customer-form :is(input:not([type=radio]),select,textarea){font-size:14px;min-height:42px;padding:9px 10px;border-radius:7px}
  #customerForm{display:grid;grid-template-columns:minmax(0,1fr) 250px;gap:12px 20px;align-items:start}
  #customerForm>.customer-edit-name{grid-column:1;grid-row:1}
  #customerForm>.customer-edit-contacts{grid-column:1;grid-row:2}
  #customerForm>.customer-add-contact{grid-column:1;grid-row:3;justify-self:start;font-size:13px;min-height:36px;padding:6px 0;border:0;text-decoration:underline;text-underline-offset:3px;margin:0}
  #customerForm>.customer-edit-note{grid-column:2;grid-row:1/4;padding-left:18px;border-left:1px solid var(--line);min-width:0}
  #customerForm>.customer-edit-note textarea{min-height:160px;line-height:1.6}
  #customerForm>.muted,#customerForm>.form-status,#customerForm>.customer-dialog-actions{grid-column:1/-1}
  .customer-edit-contact{display:grid;grid-template-columns:104px minmax(130px,1fr) 86px 68px;align-items:end;gap:8px;padding:10px;margin:0 0 8px;border-radius:8px}
  .customer-edit-contact:last-child{margin-bottom:0}.customer-edit-contact legend{display:none}
  .customer-edit-contact label{font-size:11px;gap:5px;min-width:0}
  .customer-edit-contact .customer-preferred-contact{min-height:42px;gap:5px;font-size:11px}
  .customer-edit-contact .customer-preferred-contact input{margin-right:0;width:18px;height:18px;min-height:18px;flex-shrink:0}
  .staff-page .customer-edit-contact .customer-remove-contact{min-height:42px;min-width:0;padding:7px 3px;border:0;font-size:11px;color:var(--muted);background:transparent}
  .customer-remove-contact:hover{color:var(--danger)!important;text-decoration:underline}
  .customer-dialog :is(input,select,textarea){scroll-margin-block:84px 104px}
  .staff-page .customer-dialog .customer-dialog-actions{position:sticky;bottom:-20px;z-index:2;display:flex;justify-content:flex-end;gap:8px;padding:12px 0;margin:2px 0 -20px;border-top:1px solid var(--line);background:var(--surface)}
  .staff-page .customer-dialog .customer-dialog-actions>button{flex:0 1 auto;min-width:120px;min-height:42px;width:auto;margin:0;padding:9px 16px;font-size:13px}
  .customer-dialog .form-status:empty{display:none}.customer-dialog .form-status{scroll-margin-block:84px 100px}.customer-dialog .field-error{font-size:11px;line-height:1.4}
  .customer-merge-preview h3{font-size:17px;overflow-wrap:anywhere}.customer-dialog .customer-picker{margin-bottom:12px}

  /* One settings section at a time, with a room selector beside the tariff editor. */
  #settingsPanel{max-width:1240px}.settings-intro{margin:0 0 14px!important;font-size:12px;max-width:none}
  .settings-form,.settings-editor{gap:14px}
  .staff-page .settings-mobile-nav{position:sticky;top:0;z-index:4;display:flex;gap:4px;width:fit-content;margin:0;padding:4px;border:1px solid var(--line);border-radius:10px;background:var(--surface-inset);box-shadow:0 3px 12px #0002}
  .staff-page .settings-mobile-nav>button{min-height:40px;min-width:130px;padding:8px 16px;border:0;border-radius:7px;background:transparent;color:var(--muted);font-size:13px}
  .staff-page .settings-mobile-nav>button[aria-selected=true],.staff-page .settings-mobile-nav>button[aria-selected=true]:hover:not(:disabled){color:var(--on-accent);background:var(--accent)}
  .settings-card{padding:18px;border-radius:10px}.settings-card:not([open]){display:none}
  .settings-section>summary,.settings-rules>summary{display:none}#settingsSection-spaces>.muted{display:none}.settings-card>.muted{margin:0 0 14px;font-size:12px;line-height:1.5}
  .settings-space-layout{display:grid;grid-template-columns:200px minmax(0,1fr);gap:18px;align-items:start}
  .settings-space-rail{display:block;min-width:0;position:sticky;top:64px}
  .settings-space-nav{display:grid;gap:6px}
  .staff-page .settings-space-choice{min-width:0;min-height:62px;width:100%;display:grid;gap:5px;padding:11px 12px;text-align:left;border:1px solid var(--line);background:transparent;border-radius:8px}
  .settings-space-choice strong{font-size:13px;line-height:1.4;font-weight:500;overflow-wrap:anywhere}.settings-space-choice span{font-size:11px;line-height:1.4;color:var(--muted)}
  .staff-page .settings-space-choice[aria-pressed=true]{border-color:var(--accent);background:var(--selected)}
  .settings-space-choice[aria-pressed=true] strong{color:var(--accent)}
  .settings-room-list{display:block;min-width:0}.settings-room{border:0;border-radius:0}
  .settings-room:not([open]){display:none}.settings-room>summary{display:none}
  .settings-room-body{display:grid;grid-template-columns:minmax(0,1.8fr) minmax(180px,1fr);gap:14px;padding:0;border:0}
  .settings-room .settings-identity-fields{grid-column:1/-1;grid-template-columns:minmax(0,1fr) minmax(0,1.2fr)}
  .settings-room .settings-group{margin:0;padding-top:12px;min-width:0}.settings-room .settings-day-tariff{grid-column:1}.settings-room .settings-off-tariff{grid-column:2}
  .settings-room .settings-group>.settings-hint{font-size:11px;line-height:1.5;margin-bottom:8px}
  .settings-room .settings-day-tariff .settings-fields{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
  .settings-room .settings-day-tariff .settings-fields>.settings-field:first-child{grid-column:1/-1}
  .settings-room .settings-off-tariff>.settings-field{max-width:none}
  .settings-field{font-size:12px;line-height:1.45;scroll-margin-block:64px 120px}
  .settings-field :is(input,select){font-size:14px;min-height:42px;padding:9px 10px;scroll-margin-block:74px 120px}
  .settings-room .settings-room-visibility{grid-column:1/-1;margin:0;padding-top:8px;display:grid;grid-template-columns:max-content minmax(0,1fr);gap:8px 16px;align-items:center}
  .settings-room-visibility label{font-size:12px;min-height:40px;margin:0}.settings-room-visibility .settings-hint{font-size:11px;line-height:1.45;margin:0}
  .settings-room .settings-cancel-space{grid-column:1/-1;justify-self:start;margin:0;min-height:36px;font-size:12px;padding:7px 11px}
  #addSpace{margin:12px 0 0;min-height:40px;font-size:12px;padding:9px 12px;width:200px}
  .settings-extension-pricing{margin-top:14px;padding-top:12px}
  .settings-extension-pricing>.settings-field{max-width:none;display:grid;grid-template-columns:minmax(260px,440px) minmax(0,1fr);gap:16px;align-items:start}
  .settings-extension-pricing .settings-field-help{align-self:end}
  .settings-group legend{font-size:13px;line-height:1.45}.settings-hint{font-size:11px;line-height:1.55}
  .staff-page .settings-field-help>summary{display:flex;align-items:center;gap:7px;min-height:40px;cursor:pointer;font-size:12px;list-style:none;color:var(--muted)}
  .settings-field-help>summary::before{content:'ⓘ';font-size:14px}.settings-field-help>summary::after{content:'+';font-size:18px;margin-left:auto}.settings-field-help[open]>summary::after{content:'−'}
  .settings-hours-layout{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px 24px}
  #settingsSection-hours:not([open]){display:none}
  #settingsSection-hours>.muted{margin:0 0 14px}
  .settings-hours-layout>.settings-group{margin:0;padding-top:12px}
  .settings-hours-layout>.settings-group:last-child{grid-column:1/-1}
  #settingsSection-hours .settings-time-fields{grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
  #settingsSection-hours .settings-time-fields.settings-pair{grid-template-columns:repeat(2,minmax(0,1fr))}
  .settings-time-ranges{margin:0 0 10px;font-size:13px;line-height:1.5}
  .settings-rules[open]>.settings-fields{margin-top:0;gap:18px 24px}.settings-rules>.settings-hint{margin-top:14px}
  .settings-actions{bottom:12px;gap:12px;padding:10px 14px;border-radius:9px}.settings-actions p{font-size:12px}
  .settings-action-buttons button{min-height:42px;padding:9px 15px;font-size:13px}
  .settings-actions[data-dirty=false]{padding:0;border:0;background:transparent;box-shadow:none;min-height:28px}
  .settings-actions[data-dirty=false] .settings-action-buttons{display:none}.settings-audit{margin-top:8px;font-size:11px}
}
@media(min-width:761px) and (max-width:1100px){
  .customer-profile{grid-template-columns:240px minmax(0,1fr)}.customer-booking-stats{grid-template-columns:repeat(2,minmax(0,1fr))}
  .customer-header-tools{flex-shrink:1}.customer-table th,.customer-table td{padding:9px}
  #customerForm{grid-template-columns:minmax(0,1fr)}
  #customerForm>.customer-edit-note{grid-column:1;grid-row:4;padding:0;border:0}#customerForm>.customer-edit-note textarea{min-height:76px}
  .settings-space-layout{grid-template-columns:170px minmax(0,1fr);gap:14px}
  .settings-room-body{grid-template-columns:minmax(0,1fr)}.settings-room .settings-day-tariff,.settings-room .settings-off-tariff{grid-column:1}
  .settings-room .settings-identity-fields{grid-template-columns:1fr}.settings-room .settings-day-tariff .settings-fields{grid-template-columns:1.5fr 1fr 1fr}.settings-room .settings-day-tariff .settings-fields>.settings-field:first-child{grid-column:auto}
  .settings-room .settings-room-visibility{grid-template-columns:1fr;gap:0}.settings-extension-pricing>.settings-field{grid-template-columns:1fr;gap:2px}
}
