@layer rental-features {
  .schedule-filter-shell { margin-bottom: 12px; }
  .schedule-filter-shell > summary { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 4px 8px; padding: 8px 12px; min-height: 40px; list-style: none; cursor: pointer; font-size: 13px; color: var(--ui-text-secondary); }
  .schedule-filter-shell > summary::-webkit-details-marker { display: none; }
  .schedule-filter-shell > summary::after { content: '⌄'; }
  .schedule-filter-shell[open] > summary::after { content: '⌃'; }
  @media (min-width: 721px) { .schedule-filter-shell > summary { display: none; } .schedule-shared-filters { padding: 12px; } }
  .schedule-shared-filters { display: grid; grid-template-columns: minmax(130px,.8fr) minmax(160px,1fr) minmax(220px,1.4fr) auto; align-items: end; gap: 8px; padding: 0 12px 12px; }
  .schedule-shared-filters label { display: grid; min-width: 0; gap: 4px; color: var(--ui-text-secondary); font-size: 13px; }
  .schedule-filter-summary { margin: 0; color: var(--ui-muted); font-size: 12px; }
  .schedule-result-note { margin: 0; padding: 10px 14px; color: var(--ui-muted); font-size: 13px; line-height: 1.6; }
  .availability-form-grid { grid-template-columns: repeat(4,minmax(0,1fr)); gap: 10px; padding: 14px; }
  .availability-form-grid > label, .availability-method-field { min-width: 0; font-size: 13px; }
  .availability-method-field legend { font-size: 13px; }
  .availability-rule-note { padding: 0 14px 12px; font-size: 12px; flex-wrap: wrap; }
  .availability-summary p { font-size: 13px; }
  .schedule-empty-state strong { font-size: 16px; }
  .schedule-empty-state p { font-size: 13px; }
  .query-only-badge { font-size: 12px; }
  .availability-summary > div:nth-child(2) > strong { font-size: 18px; }
  .availability-summary.unavailable { background: var(--ui-surface); border-color: var(--ui-warning-border); color: var(--ui-text); }
  .availability-summary.unavailable .availability-summary-icon { background: var(--ui-warning); }
  .schedule-counts { display: flex; flex-wrap: wrap; gap: 8px 16px; padding: 12px 14px; border: 1px solid var(--ui-border); border-radius: var(--ui-panel-radius); background: var(--ui-paint-surface); }
  .schedule-count { display: flex; align-items: center; gap: 6px; color: var(--ui-muted); font-size: 13px; }
  .schedule-count strong { color: var(--ui-text); font-size: 18px; }
  .schedule-count.positive strong { color: var(--ui-success); }
  .schedule-count.pending strong, .schedule-risk-text { color: var(--ui-warning); }
  .schedule-candidate-copy { min-width: 0; display: grid; gap: 4px; }
  .schedule-candidate-copy strong { font-size: 16px; color: var(--ui-text); overflow-wrap: anywhere; }
  .schedule-candidate-copy small, .schedule-candidate-copy p { font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; }
  .schedule-candidate { display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 12px; padding: 12px; margin-bottom: 8px; border: 1px solid var(--ui-border); border-radius: 10px; background: var(--ui-surface-subtle); }
  .schedule-candidate.recommended { border-color: var(--ui-success-border); }
  .schedule-check-pending { background: var(--ui-warning-soft); color: var(--ui-warning); }
  .availability-candidate-actions { flex-wrap: wrap; justify-content: flex-end; max-width: 310px; }
  .availability-result-title span { font-size: 13px; }
  .schedule-reason-group { border-top: 1px solid var(--ui-border); padding: 8px 0; }
  .schedule-reason-group summary { min-height: 40px; display: flex; align-items: center; gap: 8px; cursor: pointer; color: var(--ui-text-secondary); font-weight: 600; font-size: 14px; }
  .schedule-reason-group summary::before { content: '+'; color: var(--ui-muted); }
  .schedule-reason-group[open] summary::before { content: '−'; }
  .availability-reasons p { display: grid; grid-template-columns: minmax(160px,.8fr) minmax(0,2fr); align-items: start; gap: 12px; padding: 10px; background: var(--ui-surface-subtle); color: var(--ui-text-secondary); font-size: 13px; }
  .availability-reasons p .text-btn { text-align: left; white-space: normal; overflow-wrap: anywhere; }
  .availability-reasons p span { font-size: 13px; line-height: 1.6; }
  .schedule-forecast-v2 { width: 100%; min-width: 960px; table-layout: auto; border-collapse: collapse; }
  .schedule-forecast-v2 :is(th,td) { padding: 10px 8px; border-bottom: 1px solid var(--ui-border); text-align: left; }
  .schedule-forecast-v2 td { white-space: normal; font-size: 13px; }
  .schedule-forecast-v2 th { white-space: nowrap; font-size: 12px; }
  .schedule-forecast-v2 :is(th,td):first-child { width: 200px; min-width: 180px; }
  .schedule-forecast-v2 td:first-child > strong { display: block; color: var(--ui-text); font-size: 14px; overflow-wrap: anywhere; }
  .schedule-forecast-v2 td:first-child > small { display: block; font-size: 12px; color: var(--ui-muted); }
  .schedule-number { display: grid; min-width: 36px; align-content: center; gap: 2px; font-size: 15px; color: var(--ui-info); }
  .schedule-number-content { display: grid; gap: 2px; justify-items: start; }
  .schedule-number-content b { white-space: nowrap; font-size: 16px; font-weight: 650; }
  .schedule-number small { color: var(--ui-muted); font-size: 11px; font-weight: 400; }
  .schedule-forecast-v2 .schedule-status { white-space: normal; font-size: 12px; }
  .schedule-forecast-toggle { display: none; }
  .schedule-devices-list { display: grid; gap: 8px; padding: 12px; }
  .schedule-device-item { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; border-bottom: 1px solid var(--ui-border); padding: 10px 0; }
  .schedule-device-item > div { flex: 1 1 250px; min-width: 0; display: grid; gap: 4px; overflow-wrap: anywhere; }
  .schedule-device-item small { color: var(--ui-muted); font-size: 13px; }
  .precise-date-nav { display: flex; flex-wrap: wrap; }
  .precise-date-nav .input { min-width: 100px; }
  .precise-schedule-toolbar { padding: 10px 14px; }
  .precise-search-row { padding: 0 14px 10px; }
  .precise-legend { padding: 0 14px 10px; font-size: 12px; line-height: 1.7; gap: 6px 12px; }
  .schedule-more-row { padding: 10px 14px; text-align: center; }
  .schedule-more-row:has([hidden]) { display: none; }
  .precise-schedule-scroll { overscroll-behavior-x: contain; overflow-anchor: none; }
  .schedule-timeline { --schedule-sn-width: 240px; width: calc(var(--schedule-sn-width) + var(--schedule-track-width)); min-width: 100%; }
  .schedule-grid-head, .schedule-device-row { display: grid; grid-template-columns: var(--schedule-sn-width) var(--schedule-track-width); }
  .schedule-grid-head { position: sticky; top: 0; z-index: 8; min-height: 52px; background: var(--ui-surface-subtle); border-bottom: 1px solid var(--ui-border); }
  .schedule-sn-label { position: sticky; left: 0; z-index: 5; display: flex; align-items: center; min-width: 0; padding: 8px 10px; border-right: 1px solid var(--ui-border); background: var(--ui-surface); font-size: 13px; }
  .schedule-grid-head .schedule-sn-label { z-index: 9; background: var(--ui-surface-subtle); font-weight: 600; }
  .schedule-days { display: grid; grid-template-columns: repeat(var(--schedule-days),var(--schedule-day-width)); }
  .schedule-days > span { display: grid; place-content: center; text-align: center; gap: 3px; border-right: 1px solid var(--ui-border); color: var(--ui-muted); }
  .schedule-days b { font-size: 12px; }
  .schedule-days small { font-size: 12px; }
  .schedule-days .today { color: var(--ui-primary); background: var(--ui-primary-soft); }
  .schedule-device-row { min-height: var(--schedule-row-height); border-bottom: 1px solid var(--ui-border); }
  .schedule-device-label { display: grid; align-content: center; gap: 3px; width: var(--schedule-sn-width); border: 0; border-right: 1px solid var(--ui-border); text-align: left; font: inherit; cursor: pointer; }
  .schedule-device-label strong { font-size: 13px; color: var(--ui-text); white-space: normal; overflow-wrap: anywhere; }
  .schedule-device-label small { font-size: 12px; color: var(--ui-muted); white-space: normal; overflow-wrap: anywhere; }
  .schedule-device-label em { font-size: 12px; font-style: normal; color: var(--ui-success); }
  .schedule-device-label em.pending { color: var(--ui-warning); }
  .schedule-device-label em.occupied { color: var(--ui-info); }
  .schedule-track { position: relative; min-height: var(--schedule-row-height); background-image: repeating-linear-gradient(to right,transparent 0,transparent calc(var(--schedule-day-width) - 1px),var(--ui-border) calc(var(--schedule-day-width) - 1px),var(--ui-border) var(--schedule-day-width)); }
  .schedule-today-line { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--ui-primary-border); pointer-events: none; }
  .schedule-stage { position: absolute; z-index: 2; display: flex; align-items: center; min-width: 0; min-height: 40px; padding: 3px 6px; border: 1px solid var(--ui-info-border); border-radius: 5px; background: var(--ui-info-soft); color: var(--ui-info); font: inherit; font-size: 12px; text-align: left; cursor: pointer; }
  .schedule-stage > span { position: sticky; left: calc(var(--schedule-sn-width) + 6px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .schedule-stage.outbound, .schedule-stage.return, .schedule-stage.unknown, .schedule-stage.maintenance, .schedule-stage.inspection { color: var(--ui-warning); background: var(--ui-warning-soft); border-color: var(--ui-warning-border); }
  .schedule-stage.overdue { color: var(--ui-danger); background: var(--ui-danger-soft); border-color: var(--ui-danger-border); }
  .schedule-stage.completed { color: var(--ui-muted); background: var(--ui-surface-muted); border-color: var(--ui-border); }
  .schedule-model-heading { position: relative; min-height: 40px; border-bottom: 1px solid var(--ui-border); background: var(--ui-surface-subtle); }
  .schedule-model-heading > button { position: sticky; left: 0; max-width: calc(var(--schedule-sn-width) + 250px); min-height: 40px; padding: 8px 10px; text-align: left; white-space: normal; overflow-wrap: anywhere; color: var(--ui-text-secondary); }
  @media (max-width: 1000px) {
    .schedule-shared-filters { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .availability-form-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .schedule-candidate { grid-template-columns: auto minmax(0,1fr); }
    .availability-candidate-actions { grid-column: 1 / -1; max-width: none; justify-content: flex-start; }
  }
  @media (max-width: 720px) {
    .schedule-filter-shell { margin-bottom: 6px; }
    .schedule-filter-shell > summary { min-height: 44px; padding: 6px 10px; }
    .schedule-filter-summary { flex: 1 1 180px; }
    .schedule-shared-filters { padding: 0 8px 8px; gap: 6px; }
    .schedule-shared-filters label:nth-child(3) { grid-column: 1 / -1; }
    .schedule-shared-filters > button { grid-column: 2; }
    .schedule-forecast-table-wrap { border: 0; overflow: visible; max-height: none; }
    .schedule-forecast-v2 { display: block; width: 100%; min-width: 0; table-layout: auto; }
    .schedule-forecast-v2 thead { display: none; }
    .schedule-forecast-v2 tbody { display: grid; gap: 8px; padding: 8px; }
    .schedule-forecast-v2 tr { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 4px 8px; padding: 8px; border: 1px solid var(--ui-border); border-radius: var(--ui-panel-radius); }
    .schedule-forecast-v2 :is(th,td):first-child { width: auto; min-width: 0; }
    .schedule-forecast-v2 td { display: block; width: auto; min-width: 0; padding: 0; border: 0; overflow-wrap: anywhere; }
    .schedule-forecast-v2 td::before { content: attr(data-label); display: block; color: var(--ui-muted); font-size: 12px; line-height: 1.6; }
    .schedule-forecast-v2 td:first-child { grid-column: 1 / -1; }
    .schedule-forecast-v2 td:first-child::before { display: none; }
    .schedule-forecast-v2 td:first-child > small { display: none; }
    .schedule-forecast-v2 .forecast-expanded td:first-child > small { display: block; }
    .schedule-forecast-v2 td:nth-child(2) { order: 1; grid-column: 1; }
    .schedule-forecast-v2 td:nth-child(3) { order: 2; grid-column: 2; }
    .schedule-forecast-v2 td:nth-child(5) { order: 3; grid-column: 3; }
    .schedule-forecast-v2 td:nth-child(6) { order: 4; grid-column: 1; }
    .schedule-forecast-v2 td:last-child { order: 5; grid-column: 2 / -1; display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
    .schedule-forecast-v2 td:last-child::before { display: none; }
    .schedule-forecast-v2 td:nth-child(4), .schedule-forecast-v2 td:nth-child(7), .schedule-forecast-v2 td:nth-child(8), .schedule-forecast-v2 td:nth-child(9) { display: none; order: 6; }
    .schedule-forecast-v2 .forecast-expanded :is(td:nth-child(4),td:nth-child(7),td:nth-child(8),td:nth-child(9)) { display: block; }
    .schedule-forecast-toggle { display: inline-flex; flex: 0 0 auto; }
    .schedule-number { min-height: 44px; padding: 0; justify-items: start; }
    .schedule-number small { font-size: 12px; }
    .availability-form-grid { padding: 10px; gap: 8px; }
    .availability-form-grid label:first-child, .availability-form-grid label:nth-last-child(2), .availability-form-grid > button { grid-column: 1 / -1; }
    .availability-rule-note { padding: 0 10px 10px; display: grid; gap: 4px; }
    .schedule-counts { padding: 8px 10px; gap: 6px 12px; }
    .schedule-candidate { padding: 10px; gap: 6px 10px; }
    .availability-candidate-actions .btn { flex: 1 1 110px; }
    .availability-reasons p { grid-template-columns: 1fr; gap: 3px; }
    .schedule-reason-group summary { min-height: 44px; }
    .schedule-timeline { --schedule-sn-width: 150px; }
    .schedule-device-label strong { font-size: 12px; }
    .schedule-device-label small { font-size: 12px; }
    .schedule-stage { min-width: 44px; min-height: 44px; font-size: 12px; }
    .precise-date-nav { padding: 0; gap: 6px; width: 100%; }
    .precise-date-nav #preciseScheduleStartDate { flex: 1 1 150px; }
    .precise-date-nav #preciseScheduleRange { flex: 1 1 100%; font-size: 12px; }
    .availability-rule-note strong { font-size: 12px; text-align: left; }
    .precise-date-nav #preciseScheduleDays { flex: 1 1 100px; }
    .precise-schedule-toolbar { padding: 8px 10px; }
    .precise-search-row, .precise-legend { padding-inline: 10px; }
    .schedule-model-heading > button { min-height: 44px; max-width: calc(100vw - 34px); }
    .logistics-settings-summary { grid-template-columns: 1fr; }
    .schedule-devices-list { padding: 10px; }
    .schedule-device-item { align-items: stretch; }
    .schedule-device-item .btn { flex: 1; }
  }
}
