.planning-toolbar { display:flex; flex-wrap:wrap; gap:12px; align-items:end; margin-bottom:16px; }
#mobileVisits { display:grid; grid-template-columns:none; grid-auto-flow:column; grid-auto-columns:165px; gap:2px; overflow-x:auto; align-items:start; background:white; padding:1px; }
#mobileCare .cockpit-legacy { display:none !important; }
#mobileVisits .cockpit-column { border:1px solid #80b4e4; }
#mobileVisits .cockpit-column>h3 { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
#mobileVisits .cockpit-column { background:white; min-width:0; }
#mobileVisits .cockpit-column>h3 { margin:0; padding:4px; background:#619fd1; color:white; font:600 13px Arial,sans-serif; }
#mobileVisits .cockpit-duty { background:#eff2f4; padding:3px; margin:2px; border:1px solid #aaa; border-radius:2px; font-size:11px; line-height:1.4; }
#mobileVisits .cockpit-visit { padding:3px; margin:2px; border:1px solid #aaa; border-radius:2px; font-size:11px; line-height:1.4; overflow-wrap:anywhere; }
#mobileVisits .cockpit-visit:nth-child(even) { background:#f7f8f9; }
#mobileVisits .cockpit-visit>strong { display:block; font-size:11px; margin-bottom:2px; }
#mobileVisits .cockpit-visit.running { border-left:4px solid #d8a120; }
#mobileVisits .cockpit-visit.completed { border-left:4px solid #459267; }
#mobileVisits button { width:auto; padding:5px 8px; margin-top:6px; }
#mobileVisits summary { cursor:pointer; margin-top:5px; }
#mobileCare>.panel>label { display:inline-grid; width:240px; margin:0 12px 12px 0; }
#tours .tour-board { gap:2px; grid-auto-columns:165px; }
#tours .tour-card { border-radius:0; box-shadow:none; padding:0; min-width:0; overflow-wrap:anywhere; }
#tours .tour-card header { flex-wrap:wrap; margin-bottom:0; }
#tours .tour-card header input { flex:1 1 100%; }
#tours .tour-card input,#tours .tour-card select { box-sizing:border-box; padding:5px; font-size:12px; }
#tours .tour-card button { font-size:12px; padding:4px 7px; white-space:normal; }
#tours .tour-fields { grid-template-columns:minmax(0,1fr); }
#tours .tour-stops { font-size:12px; margin:6px 0; }
#tours .tour-stops strong { font-size:13px; }
#mobileVisits .cockpit-column { overflow-wrap:anywhere; }
#tours .tour-card>header { padding:6px; background:#619fd1; }
#tours .tour-fields { padding:8px; background:#eff2f4; gap:6px; }
#tours .tour-stops>li { border-radius:0; margin:0; padding:8px; border-bottom:1px solid #d8dfe4; background:white; }
#tours .tour-stops>li:nth-child(even) { background:#f7f8f9; }
@media(max-width:600px){#mobileVisits{grid-auto-columns:165px}}
.planning-toolbar label { display:grid; gap:4px; font-size:13px; }
.tour-layout { grid-template-columns:230px minmax(0,1fr); }
.tour-board-panel { min-width:0; }
.tour-board-panel>.panel-head { display:block; }
.tour-board-panel>.panel-head .button-row { margin-top:10px; display:flex; flex-wrap:wrap; gap:6px; }
.tour-board-panel>.panel-head input,.tour-board-panel>.panel-head select { width:170px; min-width:0; }
.tour-board { display:grid; grid-template-columns:none; grid-auto-flow:column; grid-auto-columns:310px; gap:12px; overflow-x:auto; align-items:start; padding-bottom:12px; }
.tour-board:has(>.tour-card:only-child) { grid-auto-columns:minmax(300px,1fr); }
#planningWarnings:not(:empty) { background:#fff0d7; color:#783e0c; border-left:4px solid #ca7918; padding:12px; margin-bottom:12px; }
.visit-pool { border-bottom:1px solid #dce2e5; padding:12px 4px; display:grid; gap:5px; cursor:grab; }
.visit-pool small, .tour-stops small { color:#586366; display:block; overflow-wrap:anywhere; }
.visit-pool.is-assigned { color:#176a46; background:#f0f8f1; cursor:default; }
.visit-assignment { display:flex; gap:4px; }
.visit-assignment select { min-width:0; flex:1; }
.tour-card { border:1px solid #ccd8dc; border-radius:6px; padding:12px; min-width:280px; background:#fff; }
.tour-card header { display:flex; gap:6px; margin-bottom:10px; }
.tour-card header input { min-width:0; width:100%; font-weight:600; }
.tour-fields { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.tour-fields label { display:grid; font-size:12px; gap:4px; min-width:0; }
.tour-fields select,.tour-fields input { width:100%; min-width:0; }
.tour-stops { list-style:none; padding:0; margin:12px 0; min-height:40px; }
.tour-stops li { border-top:1px solid #cedade; padding:10px 4px; cursor:grab; display:grid; gap:6px; }
.tour-stops li label { display:flex; align-items:center; gap:8px; font-size:12px; }
.tour-stops li input { width:70px; }
.tour-stops .invalid-slot { border-left:3px solid #ae3535; background:#fff0f0; }
.tour-stops button { padding:4px 10px; min-width:32px; }
#tourWeekBoard { display:grid; grid-template-columns:repeat(7,minmax(170px,1fr)); overflow:auto; border:1px solid #cedade; }
#tourWeekBoard[hidden] { display:none; }
#tourWeekBoard>section { padding:10px; border-right:1px solid #cedade; }
#tourWeekBoard h3 { font-size:14px; margin:16px 0 4px; }
#tourWeekBoard p { font-size:12px; border-bottom:1px solid #e2e6e8; padding:8px 0; }
.month-scroll { overflow:auto; max-height:72vh; border:1px solid #cfd8dc; }
.month-roster { border-collapse:collapse; width:max-content; min-width:100%; font-size:12px; }
.month-roster td,.month-roster th { border:1px solid #d6dfe3; padding:5px; min-width:80px; vertical-align:top; }
.month-roster thead th { position:sticky; top:0; z-index:2; background:#eef2f3; }
.month-roster tr>th:first-child { position:sticky; left:0; z-index:1; min-width:170px; max-width:200px; background:white; text-align:left; }
.month-roster thead th:first-child { z-index:3; }
.month-roster small { display:block; font-size:10px; font-weight:400; margin-top:3px; }
.month-roster .weekend { background:#f4f1e8; }
.shift-cell { background:#e1f1e9; color:#20523e; border:1px solid #a9cfbc; padding:5px; width:100%; min-height:43px; border-radius:3px; }
.shift-cell.missing-actual { background:#f4f4f4; color:#6b6b6b; border-color:#ccc; }
.add-shift-cell { color:#536870; background:transparent; padding:2px 7px; width:28px; height:25px; }

#scheduleMonthGrid { min-width:0; max-width:100%; }
#scheduleMonthGrid .month-roster { table-layout:fixed; width:calc(var(--month-days, 31) * 96px + 340px); min-width:0; }
#scheduleMonthGrid .month-roster td,
#scheduleMonthGrid .month-roster th { box-sizing:border-box; width:96px; min-width:0; max-width:none; overflow-wrap:anywhere; white-space:normal; }
#scheduleMonthGrid .month-roster tr > th:first-child { width:180px; min-width:0; max-width:180px; }
#scheduleMonthGrid .month-roster tr > :nth-last-child(-n+2) { width:80px; }
#scheduleMonthGrid .shift-cell { box-sizing:border-box; display:block; min-width:0; max-width:100%; margin-bottom:4px; white-space:normal; overflow-wrap:anywhere; }
.shift-editor { width:min(650px,94vw); max-height:90vh; overflow:auto; border:1px solid #b9c8ca; border-radius:6px; padding:24px; }
.shift-editor::backdrop { background:#0006; }
.shift-editor form { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.shift-editor form>.two-col { grid-column:1/-1; }
.shift-editor h2,.shift-editor .button-row,.shift-editor [role=alert] { grid-column:1/-1; }
.shift-editor label { display:grid; gap:4px; }
#shiftEditorError { color:#a72c2c; }
@media(max-width:800px) { .tour-layout { grid-template-columns:1fr; } .tour-board { grid-template-columns:1fr; grid-auto-flow:row; grid-auto-columns:auto; } .tour-board-panel .panel-head { display:block; } }
#planningPrintDialog { width:96vw; max-width:1600px; height:90vh; overflow:auto; border:1px solid #c3cdd3; border-radius:4px; }
#planningPrintDialog::backdrop { background:#0006; }
#planningPrintContent { padding:16px; background:white; color:#111; }
#planningPrintContent h1 { font-size:20px; }
#planningPrintContent h2 { font-size:16px; }
#planningPrintContent table { border-collapse:collapse; width:100%; }
#planningPrintContent td,#planningPrintContent th { border:1px solid #bbb; padding:6px; text-align:left; }
.printed-tour { margin-bottom:24px; }
@media print {
  body.printing-planning > :not(#planningPrintDialog) { display:none !important; }
  body.printing-planning #planningPrintDialog { display:block !important; position:static; width:auto; height:auto; max-width:none; max-height:none; overflow:visible; margin:0; padding:0; border:0; }
  #planningPrintContent { padding:0; }
  #planningPrintContent.roster-print { page:roster-sheet; }
  #planningPrintContent.tour-print { page:tour-sheet; }
  #planningPrintContent .month-roster { table-layout:fixed; min-width:0; width:100%; font-size:7px; }
  #planningPrintContent .month-roster td,#planningPrintContent .month-roster th { position:static; min-width:0; max-width:none; padding:3px 1px; overflow-wrap:anywhere; }
  #planningPrintContent .month-roster tr>th:first-child { width:85px; min-width:0; }
  #planningPrintContent .month-roster small { font-size:7px; }
  #planningPrintContent tr { break-inside:avoid; }
  .printed-tour { break-before:page; }
  .printed-tour:first-of-type { break-before:auto; }
  @page roster-sheet { size:A3 landscape; margin:10mm; }
  @page tour-sheet { size:A4 landscape; margin:10mm; }
}
