/* R5: personal workspace arrangement; the R4 palette and component styles stay intact. */
.custom-home-layout .dashboard-main{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px;align-items:start}
.custom-home-layout .dashboard-main>.home-welcome,.custom-home-layout .dashboard-main>.home-metrics,.custom-home-layout .home-layout-toolbar,.custom-home-layout .widget-wide{grid-column:1/-1}
.custom-home-layout .dashboard-main>.home-welcome,.custom-home-layout .dashboard-main>.home-metrics{margin-bottom:0}
.custom-home-layout [data-widget]{min-width:0;width:100%;margin:0!important;position:relative}
.custom-home-layout .home-calendar-panel,.custom-home-layout .home-chat-panel{padding:16px}
.custom-home-layout .home-calendar-panel header,.custom-home-layout .home-chat-panel header{display:flex;gap:8px;align-items:center;justify-content:space-between;flex-wrap:wrap;margin-bottom:12px}
.custom-home-layout .home-calendar-panel h2,.custom-home-layout .home-chat-panel h2{font-size:15px}
.widget-size{font-size:11px;padding:6px 9px;min-height:32px;background:var(--subtle);color:var(--accent)}
.custom-home-layout .home-calendar-panel:not(.widget-wide) .month-layout{grid-template-columns:minmax(0,1fr);gap:12px}
.custom-home-layout .home-calendar-panel:not(.widget-wide) .planning-toolbar{flex-direction:column;align-items:stretch;gap:9px;margin-bottom:12px}
.custom-home-layout .home-calendar-panel:not(.widget-wide) .calendar-modes{align-self:flex-start}
.custom-home-layout .home-calendar-panel:not(.widget-wide) .mini-calendar-toolbar{flex-wrap:wrap}
.custom-home-layout .home-calendar-panel:not(.widget-wide) .mini-calendar-toolbar strong{font-size:13px;min-width:110px;flex:1}
.custom-home-layout .home-calendar-panel:not(.widget-wide) .mini-calendar-toolbar button{min-width:29px;min-height:30px;padding:4px 7px}
.custom-home-layout .home-calendar-panel:not(.widget-wide) .mini-days button{height:46px;min-height:46px!important;padding:4px}
.custom-home-layout .home-calendar-panel:not(.widget-wide) .month-event-label{display:none}
.custom-home-layout .home-calendar-panel:not(.widget-wide) .month-event-count{font-size:8px}
.custom-home-layout .home-calendar-panel:not(.widget-wide) .mini-week span{padding:7px 0;font-size:10px}
.custom-home-layout .home-calendar-panel:not(.widget-wide) .plan-agenda{max-height:150px!important}
.custom-home-layout .home-chat-panel #home-chats{max-height:570px;overflow:auto;scrollbar-width:thin}
.custom-home-layout .home-chat-panel .home-chat{padding:14px 0;min-height:100px}
.custom-home-layout .home-chat-panel .home-chat-body>span{white-space:normal;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden;line-height:1.55;max-height:none;font-size:12px}
.home-layout-toolbar{display:flex;justify-content:flex-end;gap:12px;align-items:center;flex-wrap:wrap;color:var(--muted);font-size:11px}
.home-layout-toolbar>button{font-size:11px;padding:7px 11px}
.layout-editing .home-layout-toolbar>button{background:var(--accent-soft);color:var(--accent)}
.widget-move-tools{display:none;gap:5px;align-items:center;margin-bottom:12px;padding-bottom:10px;border-bottom:1px dashed var(--line)}
.layout-editing .widget-move-tools{display:flex}
.widget-move-tools button{min-width:32px;min-height:32px;font-size:13px;padding:5px 7px}
.widget-move-tools .widget-grab{flex:1;text-align:left;cursor:grab;min-width:0;color:var(--muted);background:transparent;border:0}
.widget-grab span{font-size:10px;margin-left:4px}
.widget-grab:active{cursor:grabbing}
.widget-drop-target{outline:2px dashed var(--accent)!important;outline-offset:4px}
.widget-dragging{opacity:.45}
.layout-editing .dashboard-main,.layout-editing .dashboard-rail{min-height:120px;padding-bottom:30px}
.layout-settings{margin-bottom:22px}
.layout-settings h2{font-size:18px;margin-bottom:10px}
.layout-settings p,.layout-settings small{color:var(--muted);font-size:13px;line-height:1.6}
.layout-settings small{display:block;margin-top:12px}
.layout-settings button{margin-top:10px}
.custom-home-layout .dashboard-rail .month-layout{grid-template-columns:minmax(0,1fr)}
.custom-home-layout .dashboard-rail .home-order-preview{overflow:auto}
@media(max-width:1100px){.custom-home-layout .dashboard-main{gap:14px}.custom-home-layout .dashboard-rail{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:720px){.custom-home-layout .dashboard-main,.custom-home-layout .dashboard-rail{grid-template-columns:minmax(0,1fr)}.home-layout-toolbar{justify-content:flex-start}.widget-move-tools button{min-width:36px;min-height:36px}.custom-home-layout .home-chat-panel #home-chats{max-height:420px}.widget-grab span{font-size:11px}}

.custom-home-layout .dashboard-rail{grid-template-columns:minmax(0,1fr)!important}
