/* Dedicated app screens. Authentication and public visitor views retain their layout. */
.screen-sidebar, .screen-bottom, .screen-heading { display: none; }
body.screen-app:not(.auth-locked):not(.visitor-mode) { background: #edf2f7; }
body.screen-app:not(.auth-locked):not(.visitor-mode) .app-shell { max-width: 1480px; padding: 20px 24px 32px 228px !important; }
body.screen-app:not(.auth-locked):not(.visitor-mode) .topbar { display: block; padding: 0 !important; margin: 0 0 16px !important; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
body.screen-app:not(.auth-locked):not(.visitor-mode) .brand-hero { padding: 10px 16px !important; min-height: 64px !important; background: #102a43; border-radius: 14px; }
body.screen-app:not(.auth-locked):not(.visitor-mode) .brand-mark { display: flex !important; flex-direction: row !important; gap: 14px !important; justify-content: flex-start; }
body.screen-app:not(.auth-locked):not(.visitor-mode) .brand-logo { width: 44px !important; height: 44px !important; }
body.screen-app:not(.auth-locked):not(.visitor-mode) .eyebrow { color: white; font-size: 18px !important; margin: 0; }
body.screen-app:not(.auth-locked):not(.visitor-mode) .workspace { background: transparent; border: 0; box-shadow: none; padding: 0 !important; }
body.screen-app:not(.auth-locked):not(.visitor-mode) .screen-sidebar { display: grid; align-content: start; gap: 5px; position: fixed; top: 20px; left: max(16px, calc((100vw - 1480px)/2 + 16px)); width: 188px; max-height: calc(100vh - 40px); overflow-y: auto; padding: 12px; background: white; border-radius: 16px; }
.screen-sidebar button { display: flex; align-items: center; gap: 10px; min-height: 44px; border: 0; background: transparent; text-align: left; padding: 8px; color: #334155; font-size: 14px; }
.screen-sidebar button[aria-current="page"] { background: #e5f4f1; color: #0f766e; }
.screen-sidebar button::before, .screen-bottom button::before { content: ''; flex-shrink: 0; width: 26px; height: 26px; border-radius: 7px; background: var(--tile-icon) center / 19px no-repeat var(--tile-color); }
.screen-sidebar button[hidden], .screen-bottom button[hidden] { display: none !important; }
body.screen-app:not(.auth-locked):not(.visitor-mode) .screen-heading { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.screen-heading h1 { flex: 1; font-size: 24px; margin: 0; outline: none; }
.screen-heading button { min-height: 44px; padding: 8px 12px; }
body.screen-app[data-screen="overview"] .screen-heading { display: none !important; }
body.screen-app:not(.auth-locked):not(.visitor-mode):not([data-screen="overview"]) .connection-panel,
body.screen-app:not(.auth-locked):not(.visitor-mode):not([data-screen="overview"]) .status-grid { display: none !important; }
body.screen-app:not(.auth-locked):not(.visitor-mode) .tab-panel:not(.active) { display: none !important; }
body.screen-app:not(.auth-locked):not(.visitor-mode) .connection-panel { padding: 10px 12px !important; margin-bottom: 16px !important; border-radius: 14px !important; box-shadow: 0 2px 4px #102a4308; }
body.screen-app:not(.auth-locked):not(.visitor-mode) .status-grid { display: grid !important; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px !important; margin-bottom: 16px !important; }
body.screen-app:not(.auth-locked):not(.visitor-mode) .status-grid article { min-height: 84px !important; padding: 10px 12px !important; border-radius: 14px !important; background: white; box-shadow: 0 2px 4px #102a4308; }
body.screen-app:not(.auth-locked):not(.visitor-mode) .status-grid article span { font-size: 13px !important; }
body.screen-app:not(.auth-locked):not(.visitor-mode) .status-grid article strong { font-size: 27px !important; }
body.screen-app:not(.auth-locked):not(.visitor-mode) .dashboard-chart { border: 0; border-radius: 16px; padding: 16px !important; margin: 0 0 18px; background: white; box-shadow: 0 2px 4px #102a4308; }
body.screen-app:not(.auth-locked):not(.visitor-mode) .pie-wrap { display: grid !important; grid-template-columns: 170px minmax(0, 1fr) !important; align-items: center; gap: 18px !important; }
body.screen-app:not(.auth-locked):not(.visitor-mode) .pie-chart { width: 160px !important; height: 160px !important; }
.sections-heading { color: #5d6e84; font-size: 14px; letter-spacing: .07em; text-transform: uppercase; margin: 18px 2px 10px; }
.home-activity { margin: 16px 0; }
.home-activity > summary { cursor: pointer; padding: 14px; border-radius: 12px; background: white; color: #475569; font-weight: 600; }
.home-activity[open] > summary { margin-bottom: 12px; }
body.screen-app:not(.auth-locked):not(.visitor-mode) .pie-legend { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px 20px; border: 0; background: transparent; }
body.screen-app:not(.auth-locked):not(.visitor-mode) .legend-row { grid-template-columns: 12px minmax(0,1fr) auto; gap: 7px; min-height: 25px; }
body.screen-app:not(.auth-locked):not(.visitor-mode) .legend-row::after { display: none; }
body.screen-app:not(.auth-locked):not(.visitor-mode) .legend-row strong { grid-column: 3; }
body.screen-app:not(.auth-locked):not(.visitor-mode) .tabs { display: grid !important; grid-template-columns: repeat(4, minmax(0, 1fr)) !important; gap: 10px !important; overflow: visible !important; padding: 0 !important; margin: 0 0 20px !important; background: transparent; border: 0; box-shadow: none; position: static !important; }
body.screen-app:not(.auth-locked):not(.visitor-mode) .tabs button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; width: 100%; min-width: 0 !important; min-height: 92px !important; padding: 10px 4px !important; border: 0 !important; border-radius: 15px !important; color: #253247; background: white; font-size: 14px !important; font-weight: 650; white-space: normal; overflow-wrap: anywhere; box-shadow: 0 2px 4px #102a4308; }
body.screen-app:not(.auth-locked):not(.visitor-mode) .tabs button::before { content: ''; display: block; width: 34px; height: 34px; border-radius: 11px; background: var(--tile-icon) center / 23px no-repeat var(--tile-color); }
body.screen-app:not(.auth-locked):not(.visitor-mode) .tabs button[data-tab="overview"],
body.screen-app:not(.auth-locked):not(.visitor-mode) .tabs button[hidden] { display: none !important; }
body.screen-app:not(.auth-locked):not(.visitor-mode) #reports .report-panel { display: flex; flex-wrap: wrap; width: 100%; margin: 0 !important; padding: 16px !important; border-radius: 14px; background: white; }
body.screen-app:not(.auth-locked):not(.visitor-mode) #reports .report-panel > :not(.mobile-report-toggle) { display: revert; }
body.screen-app:not(.auth-locked):not(.visitor-mode) #reports .mobile-report-toggle { display: none !important; }
body.screen-app:not(.auth-locked):not(.visitor-mode) #reports [hidden] { display: none !important; }
body.screen-app:not(.auth-locked):not(.visitor-mode) #handover .handover-entry-form { display: grid !important; }
@media (min-width: 1100px) {
  body.screen-app:not(.auth-locked):not(.visitor-mode) #overview > .dashboard-chart { max-width: none; }
}
body.screen-app.mobile-view:not(.auth-locked):not(.visitor-mode) .app-shell { padding: 10px 12px 90px !important; }
body.screen-app.mobile-view:not(.auth-locked):not(.visitor-mode) .screen-sidebar { display: none; }
body.screen-app.mobile-view:not(.auth-locked):not(.visitor-mode) .screen-bottom { display: flex; justify-content: space-around; position: fixed; z-index: 40; bottom: 0; left: 0; right: 0; padding: 6px 6px max(8px, env(safe-area-inset-bottom)); border-top: 1px solid #dbe3ed; background: #fff; zoom: var(--phone-ui-scale, 1); }
.screen-bottom button { display: flex; flex: 1; flex-direction: column; align-items: center; gap: 4px; padding: 4px 2px; min-height: 48px; border: 0; background: white; color: #64748b; font-size: 11px; border-radius: 6px; }
.screen-bottom button[aria-current="page"] { color: #0f766e; background: #eef8f6; }
body.screen-app.mobile-view:not(.auth-locked):not(.visitor-mode) .brand-hero { border-radius: 10px; min-height: 52px !important; padding: 6px 10px !important; }
body.screen-app.mobile-view:not(.auth-locked):not(.visitor-mode) .brand-logo { width: 36px !important; height: 36px !important; }
body.screen-app.mobile-view:not(.auth-locked):not(.visitor-mode) .eyebrow { font-size: 15px !important; }
body.screen-app.mobile-view:not(.auth-locked):not(.visitor-mode) .status-grid { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; gap: 6px !important; }
body.screen-app.mobile-view:not(.auth-locked):not(.visitor-mode) .status-grid article { min-height: 70px !important; padding: 8px !important; }
body.screen-app.mobile-view:not(.auth-locked):not(.visitor-mode) .status-grid article span { font-size: 11px !important; }
body.screen-app.mobile-view:not(.auth-locked):not(.visitor-mode) .status-grid article strong { font-size: 24px !important; }
body.screen-app.mobile-view:not(.auth-locked):not(.visitor-mode) .tabs { gap: 6px !important; }
body.screen-app.mobile-view:not(.auth-locked):not(.visitor-mode) .tabs button { min-height: 80px !important; font-size: 11px !important; gap: 6px; }
body.screen-app.mobile-view:not(.auth-locked):not(.visitor-mode) .pie-wrap { grid-template-columns: 100px minmax(0, 1fr) !important; gap: 8px !important; }
body.screen-app.mobile-view:not(.auth-locked):not(.visitor-mode) .pie-chart { width: 100px !important; height: 100px !important; }
body.screen-app.mobile-view:not(.auth-locked):not(.visitor-mode) .pie-legend { padding: 0 !important; border: 0; }
body.screen-app.mobile-view:not(.auth-locked):not(.visitor-mode) .pie-legend { grid-template-columns: minmax(0,1fr); gap: 3px; }
body.screen-app.mobile-view:not(.auth-locked):not(.visitor-mode) .legend-row { min-height: 22px !important; font-size: 10px !important; }
body.screen-app.mobile-view:not(.auth-locked):not(.visitor-mode) #reports .report-panel { display: grid; grid-template-columns: minmax(0,1fr); }
body.screen-app.mobile-view:not(.auth-locked):not(.visitor-mode) .screen-heading h1 { font-size: 21px; }

/* Release 4b: calm "needs attention" cue — a soft, slow warm glow, no flashing. */
@keyframes ozAlertBreathe {
  0%, 100% { box-shadow: 0 0 0 1px rgba(234, 170, 70, .35), 0 4px 14px rgba(234, 170, 70, .10); }
  50% { box-shadow: 0 0 0 2px rgba(234, 170, 70, .45), 0 6px 20px rgba(234, 170, 70, .22); }
}
body.screen-app:not(.auth-locked):not(.visitor-mode) .tabs button.tab-alert:not(.active) { position: relative; background: linear-gradient(180deg, #fffdf8, #fff6e6) !important; color: #253247 !important; animation: ozAlertBreathe 4s ease-in-out infinite; }
body.screen-app:not(.auth-locked):not(.visitor-mode) .tabs button.tab-alert:not(.active)::before { margin: 0; box-shadow: none; }
body.screen-app:not(.auth-locked):not(.visitor-mode) .tabs button.tab-alert:not(.active)::after,
.screen-sidebar button.tab-alert::after,
.screen-bottom button.tab-alert::after { content: ''; position: absolute; top: 9px; right: 9px; width: 8px; height: 8px; border-radius: 50%; background: #eaa23f; box-shadow: 0 0 0 3px rgba(234, 162, 63, .18); }
.screen-sidebar button.tab-alert { position: relative; background: #fffaf0; }
.screen-bottom button.tab-alert { position: relative; }
.screen-bottom button.tab-alert::after { top: 3px; right: calc(50% - 20px); }
@media (prefers-reduced-motion: reduce) {
  body.screen-app .tabs button.tab-alert:not(.active) { animation: none; box-shadow: 0 0 0 2px rgba(234, 170, 70, .4), 0 5px 16px rgba(234, 170, 70, .15); }
}

/* Release 4: case follow-ups and photo removal. */
.follow-up-box { margin: 10px 0; padding: 10px 12px; border-radius: 12px; border: 1px solid #f0b35b; background: #fff8e8; color: #5b3a06; font-size: 14px; }
.follow-up-box.mine { border-color: #f59e0b; box-shadow: 0 0 0 2px rgba(245, 158, 11, .35); }
.follow-up-box.done { border-color: #a7d7c5; background: #effaf5; color: #14532d; }
.follow-up-box p { margin: 6px 0 0; white-space: pre-wrap; }
.follow-up-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; }
.follow-up-head span { color: #7a5a22; font-size: 12px; }
.follow-up-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.follow-up-actions button { min-height: 40px; }
.follow-up-done-btn { background: #0f766e !important; color: #fff !important; border-color: #0f766e !important; }
.handover-follow-ups { margin-bottom: 14px; }
.handover-follow-ups h4 { margin: 4px 0 8px; color: #8a4f05; }
.handover-item.follow-up-item { border-left: 4px solid #f59e0b; }
.handover-item.follow-up-item.mine { background: #fff8e8; }
.follow-up-dialog label { display: grid; gap: 6px; margin: 10px 0; font-weight: 600; text-align: left; }
.follow-up-dialog select, .follow-up-dialog textarea { width: 100%; min-height: 44px; font: inherit; padding: 8px; border-radius: 10px; border: 1px solid #cbd5e1; box-sizing: border-box; }
.photo-tile { position: relative; display: inline-flex; }
.photo-delete-btn { position: absolute; top: -8px; right: -8px; width: 28px; height: 28px; min-height: 0 !important; padding: 0 !important; border-radius: 50% !important; border: 2px solid #fff !important; background: #dc2626 !important; color: #fff !important; font-size: 18px; line-height: 1; font-weight: 700; display: grid; place-items: center; box-shadow: 0 2px 6px rgba(0,0,0,.25); cursor: pointer; z-index: 2; }
