/* Screen-only design system. No report canvas, print styles or business rules. */
.mobile-quick-nav { display: none; }
.app-brand-copy small { display: none; }
.app-brand-mark.brand-scene { position:relative; overflow:hidden; isolation:isolate; background:#0b3026; }
.brand-scene canvas,.brand-scene-fallback { position:absolute; inset:0; width:100%; height:100%; pointer-events:none; }
.brand-scene canvas { opacity:0; }
.brand-scene.is-ready canvas { opacity:1; }
.brand-scene.is-ready .brand-scene-fallback { visibility:hidden; }
.ui-refresh .app-brand-mark.brand-scene { flex:0 0 88px; width:88px; height:64px; background:#0b3026; border:1px solid #609f7938; border-radius:16px; box-shadow:inset 0 0 0 1px #ffffff0a; }
@media (max-width:480px) { .ui-refresh .app-brand-mark.brand-scene { flex-basis:64px; width:64px; height:58px; border-radius:14px; } }
@media (min-width:1180px) {
  .ui-refresh .app-brand { display:grid; grid-template-columns:1fr; gap:14px; text-align:center; }
  .ui-refresh .app-brand-mark.brand-scene { width:100%; height:112px; border-radius:18px; }
  .ui-refresh .app-brand .app-brand-copy { font-size:1rem; line-height:1.65; }
}
.skip-link { position: fixed; inset-block-start: 12px; inset-inline-start: 16px; z-index: 5000; transform: translateY(-180%); padding: 12px 18px; background: #fff; color: #174f3d; border: 2px solid #174f3d; border-radius: 10px; }
.skip-link:focus { transform: none; }
@media screen {
  body.ui-refresh { --ui-ink: #193a31; --ui-muted: #5b7067; --ui-line: #dfe7e2; --ui-paper: #fff; --ui-canvas: #f3f6f4; --ui-radius: 18px; --ui-sidebar: 236px; background: var(--ui-canvas); color: var(--ui-ink); }
  .ui-refresh [hidden] { display: none !important; }
  .ui-refresh .page-container { width: min(1480px, calc(100% - 64px)); padding-block: 38px 52px; outline: none; min-width: 0; }
  .ui-refresh .page-heading { gap: 20px; align-items: center; margin-bottom: 28px; }
  .ui-refresh .page-heading > div { min-width: 0; }
  .ui-refresh .page-heading h1 { font-size: clamp(1.65rem, 2.4vw, 2.25rem); letter-spacing: -.025em; color: #133e30; overflow-wrap: anywhere; }
  .ui-refresh .page-heading .eyebrow { color: #487b64; font-size: .8rem; margin-bottom: 8px; }
  .ui-refresh .page-heading :is(.muted,.subtle) { margin-top: 9px; max-width: 750px; color: var(--ui-muted); font-size: .94rem; line-height: 1.8; }
  .ui-refresh .page-container :is(.muted,.subtle,.field-hint) { color: var(--ui-muted); }
  .ui-refresh .page-container .card { border-color: var(--ui-line); border-radius: var(--ui-radius); box-shadow: 0 4px 20px #173d3005; }
  .ui-refresh .page-container .panel { padding: clamp(20px, 2.4vw, 30px); }
  .ui-refresh .page-container .panel.records-panel { padding: 0; }
  .ui-refresh .records-page .visits-filter { border: 0; border-bottom: 1px solid #e7ece9; border-radius: 0; }
  .ui-refresh .records-page .records-section-header { margin-bottom: 0; }
  .ui-refresh .records-page .data-table { min-width: 1080px; }
  .ui-refresh .records-page .data-table :is(th,td):last-child { position: sticky; inset-inline-end: 0; z-index: 1; background: #fff; border-inline-start: 1px solid #e4ece6; }
  .ui-refresh .records-page .data-table th:last-child { background: #f3f7f4; }
  .ui-refresh .section-header { gap: 16px; margin-bottom: 22px; }
  .ui-refresh .section-title { gap: 12px; min-width: 0; }
  .ui-refresh .section-title > div { min-width: 0; }
  .ui-refresh .section-title .muted { font-size: .83rem; margin-top: 5px; }
  .ui-refresh .section-icon { width: 44px; height: 44px; flex-shrink: 0; border: 1px solid #dfece4; background: #f0f7f3; border-radius: 13px; color: #266a4c; }
  .ui-refresh .page-container h2 { font-size: clamp(1.13rem, 1.5vw, 1.35rem); line-height: 1.6; }
  .ui-refresh .page-container :is(.primary-btn,.secondary-btn,.danger-btn) { min-height: 46px; border-radius: 10px; line-height: 1.6; font-size: .9rem; font-weight: 700; }
  .ui-refresh .page-container .primary-btn { background: #176347; box-shadow: 0 3px 7px #134d3412; }
  .ui-refresh .page-container .primary-btn:hover { background: #124e38; transform: none; box-shadow: 0 4px 12px #134d3424; }
  .ui-refresh .page-container .secondary-btn { color: #315e4b; border-color: #d5e2da; background: #fff; }
  .ui-refresh .page-container .secondary-btn:hover { background: #f0f7f3; border-color: #9fbcaa; }
  .ui-refresh .page-container .danger-btn { color: #a22e2b; background: #fff6f5; border-color: #f0d2cf; }
  .ui-refresh :is(.page-container,.auth-card,.modal,.workflow-dialog,.employee-report-dialog) :is(input,select,textarea):where(:not([type='checkbox']):not([type='radio']):not([type='hidden']):not([type='file'])) { min-height: 48px; border: 1px solid #cbdad1; border-radius: 10px; background-color: #fff; color: #233f32; font-size: 1rem; padding: 12px 14px; line-height: 1.5; }
  .ui-refresh :is(input,textarea)::placeholder { color: #62776a; opacity: 1; }
  .ui-refresh :is(.page-container,.auth-card,.modal,.workflow-dialog,.employee-report-dialog) :is(input,select,textarea):focus { border-color: #377f58; box-shadow: 0 0 0 3px #377f5817; }
  .ui-refresh :is(.page-container,.auth-card) input[readonly] { background: #f5f8f6; color: #4f6859; }
  .ui-refresh :is(.page-container,.auth-card) :is(input,select):disabled { color: #617468; background: #f2f5f3; }
  .ui-refresh .field-group > :is(label,.field-label), .ui-refresh .filter-field > label { font-size: .88rem; color: #345342; margin-bottom: 7px; line-height: 1.6; }
  .ui-refresh :is(.field-hint,.field-group > .muted) { font-size: .81rem; line-height: 1.8; }
  .ui-refresh :is(.page-container,.auth-card,.modal) .searchable-combobox > input { padding-inline-end: 46px; }
  .ui-refresh :is(.page-container,.auth-card,.modal) .password-wrap > input { padding-inline-end: 56px; }
  .ui-refresh .page-container .date-input-wrap > input[type='date'] { border: 0; background: transparent; box-shadow: none; }
  .ui-refresh :is(.page-container,.auth-card,.modal) .field-group.has-error :is(input,select,textarea):not([type='hidden']):not([type='radio']),
  .ui-refresh :is(.page-container,.auth-card,.modal) :is(input,select,textarea)[aria-invalid='true'] { border-color: var(--danger); background: var(--danger-soft); box-shadow: 0 0 0 3px #b4231814; }
  .ui-refresh .visit-kind-field.has-error,.ui-refresh #visit-form > .photos-section.has-error { border-color: var(--danger); background: var(--danger-soft); }
  .ui-refresh :is(a,button,summary):focus-visible { outline: 3px solid #397f59; outline-offset: 3px; }
  .ui-refresh .search-wrap input { padding-inline-start: 44px !important; }
  .ui-refresh .search-wrap .icon { color: #4b7c61; top: 15px; }
  .ui-refresh .filter-bar { padding: 18px; border: 1px solid #e1eae4; background: #f8faf8; border-radius: 13px; gap: 14px; }
  .ui-refresh .table-wrap { overflow: auto; border-color: #e1e9e3; border-radius: 12px; scrollbar-color: #b8cec0 #f4f7f5; }
  .ui-refresh .data-table { font-size: .9rem; }
  .ui-refresh .data-table th { padding: 15px 13px; background: #f3f7f4; color: #577160; font-size: .8rem; }
  .ui-refresh .data-table td { padding: 17px 13px; border-color: #e8eee9; line-height: 1.7; overflow-wrap: anywhere; }
  .ui-refresh .data-table tbody tr:hover { background: #f7fbf8; }
  .ui-refresh .data-table td.status-cell { display: table-cell; }
  .ui-refresh .status-cell { grid-template-columns: minmax(0,1fr); }
  .ui-refresh .status-badge { max-width: 100%; white-space: normal; line-height: 1.7; border-radius: 8px; padding: 5px 9px; }
  .ui-refresh .status-badge::before { flex: 0 0 5px; width: 5px; height: 5px; }
  .ui-refresh .table-actions { flex-wrap: wrap; }
  .ui-refresh .table-actions .btn { font-size: .8rem; min-height: 40px; padding: 7px 11px; }
  .ui-refresh .record-card-head { flex-wrap: wrap; }
  .ui-refresh .record-card-head > div { min-width: 0; }
  .ui-refresh .record-card-head > div:first-child { flex: 1 1 125px; overflow-wrap: anywhere; }
  .ui-refresh .record-card-head .status-cell { flex: 0 1 155px; }
  .ui-refresh .record-card { padding: 20px; }
  .ui-refresh .record-card .eyebrow { font-size: 1.05rem; color: #1d6245; overflow-wrap: anywhere; }
  .ui-refresh .record-meta { gap: 16px; line-height: 1.8; }
  .ui-refresh .record-meta > div { min-width: 0; overflow-wrap: anywhere; }
  .ui-refresh .record-meta span { color: #61766a; margin-bottom: 3px; }
  .ui-refresh .empty-state { background: #fafcfb; border-color: #dce7df; border-style: solid; padding-block: 48px; }
  .ui-refresh .pagination { padding-top: 22px; }

  /* The same navigation links, presented as a desktop workspace sidebar. */
  .ui-refresh .app-brand-copy { display: grid; gap: 5px; }
  .ui-refresh .app-brand-copy small { display: block; color: #61796a; font-size: .68rem; font-weight: 500; }
  @media (min-width: 1180px) {
    .ui-refresh .app-shell { padding-inline-start: var(--ui-sidebar); }
    .ui-refresh .app-header { position: fixed; inset-block: 0; inset-inline-start: 0; width: var(--ui-sidebar); padding: 0; z-index: 700; color: #284d39; background: #fff; border-inline-end: 1px solid #dce7df; box-shadow: none; backdrop-filter: none; }
    .ui-refresh .header-inner { width: 100%; height: 100%; min-height: 0; margin: 0; padding: 30px 16px 20px; display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 30px; overflow-y: auto; }
    .ui-refresh .app-brand { gap: 10px; font-size: .88rem; white-space: normal; align-items: center; padding: 0 1px 24px; border-bottom: 1px solid #e3ebe5; }
    .ui-refresh .app-brand-mark { flex: 0 0 40px; height: 42px; color: #fff; background: #185d42; border-radius: 12px; }
    .ui-refresh .desktop-nav { display: flex; flex-direction: column; align-self: auto; gap: 8px; }
    .ui-refresh .desktop-nav::before { content: 'مساحة العمل'; padding: 0 14px 10px; font-size: .73rem; color: #637b69; font-weight: 500; }
    .ui-refresh .desktop-nav a { min-height: 49px; gap: 13px; padding: 12px 14px; border: 1px solid transparent; border-radius: 11px; color: #556f5f; font-size: .88rem; }
    .ui-refresh .desktop-nav a:hover { color: #195f3e; background: #f4f8f5; border-color: #e3ebe5; }
    .ui-refresh .desktop-nav a.active { color: #18543a; background: #eaf4ee; border-color: #d4e7d9; font-weight: 800; }
    .ui-refresh .desktop-nav .icon { width: 19px; height: 19px; }
    .ui-refresh .user-area { margin-top: auto; padding-top: 22px; border-top: 1px solid #e3ebe5; }
    .ui-refresh .account-menu-shell { display: block; width: 100%; }
    .ui-refresh .account-menu-trigger { width: 100%; min-height: 62px; color: #31523e; background: #f4f8f5; border: 1px solid #e0e9e3; justify-content: space-between; padding: 12px; }
    .ui-refresh .user-meta { min-width: 0; line-height: 1.6; }
    .ui-refresh .user-meta strong { font-size: .85rem; overflow-wrap: anywhere; }
    .ui-refresh .user-meta span { color: #597563; font-size: .75rem; }
    .ui-refresh .account-menu { top: auto; bottom: calc(100% + 9px); inset-inline: 0; width: 100%; }
    .ui-refresh .menu-btn { display: none; }
  }
  @media (max-width: 1179px) {
    .ui-refresh .app-header { background: #fff; color: #173d2b; border-bottom: 1px solid #dfe8e1; box-shadow: 0 3px 10px #163e2906; backdrop-filter: none; }
    .ui-refresh .header-inner { min-height: 74px; width: calc(100% - 40px); }
    .ui-refresh .app-brand { font-size: .95rem; white-space: normal; }
    .ui-refresh .app-brand-mark { color: #fff; background: #185d42; }
    .ui-refresh .desktop-nav,.ui-refresh .account-menu-shell { display: none; }
    .ui-refresh .menu-btn { display: inline-flex; color: #28583d; border-color: #dce7df; width: 44px; height: 44px; min-height: 44px; }
    .ui-refresh .drawer { background: #123d2a; box-shadow: -8px 0 50px #0b2e241f; }
    .ui-refresh .drawer-head .icon-btn { color: #e2efe7; border-color: #ffffff38; }
    .ui-refresh .drawer-nav a.active { background: #ffffff1c; border: 1px solid #ffffff2b; }
    .ui-refresh .drawer-nav a,.ui-refresh .drawer-nav button { min-height: 50px; }
  }

  /* Dashboard: real figures, no decorative or fabricated statistics. */
  .ui-refresh .hero-strip { min-height: 224px; padding: 34px; margin-bottom: 24px; border-radius: 22px; background: #144a34; background-image: radial-gradient(ellipse at 0 100%,#2f785233,transparent 60%); align-items: center; }
  .ui-refresh .hero-strip::after { width: 270px; height: 270px; left: -90px; bottom: -190px; border-width: 44px; opacity: .8; }
  .ui-refresh .hero-strip > div { position: relative; z-index: 1; min-width: 0; }
  .ui-refresh .hero-strip h1 { color: #fff; line-height: 1.6; font-size: clamp(1.45rem,2.2vw,2rem); }
  .ui-refresh .hero-strip .subtle { color: #c6ddce; margin-top: 9px; }
  .ui-refresh .hero-strip .page-actions { flex-direction: column; flex: 0 1 260px; }
  .ui-refresh .hero-strip .page-actions a { box-shadow: none; }
  .ui-refresh .hero-strip #workflow-queue-link { background: transparent !important; border-color: #a6ceb957; color: #e4f2e9 !important; font-size: .8rem; }
  .ui-refresh .stats-grid { grid-template-columns: repeat(auto-fit,minmax(140px,1fr)); gap: 14px; margin-bottom: 28px; }
  .ui-refresh .stat-card { display: flex; flex-direction: column; align-items: stretch; justify-content: space-between; min-height: 152px; padding: 21px; border-radius: 16px; gap: 15px; position: relative; overflow: hidden; }
  .ui-refresh .stat-card::before { content: ''; position: absolute; height: 3px; inset: 0 20px auto; border-radius: 0 0 4px 4px; background: #d3e4d9; }
  .ui-refresh .stat-card:first-child { background: #e9f3ed; border-color: #cee2d4; }
  .ui-refresh .stat-card:first-child::before { background: #287849; }
  .ui-refresh .stat-head { color: #5a7062; line-height: 1.8; font-size: .8rem; }
  .ui-refresh .stat-value { color: #1a5136; font-size: 2.3rem; margin: 0; font-variant-numeric: tabular-nums; }
  .ui-refresh .return-analytics-panel { background: #fff; margin-bottom: 28px; }
  .ui-refresh .return-analytics-panel::before { display: none; }
  .ui-refresh .return-analytics-summary article { background: #f7faf8; box-shadow: none; border-color: #e2eae5; }
  .ui-refresh .return-owner-card { border-radius: 14px; box-shadow: none; border-color: #e3eae5; }
  .ui-refresh .return-analytics-grid { align-items: start; }
  .ui-refresh .return-owner-card { padding: 16px; gap: 12px; }
  .ui-refresh details.return-owner-reasons { padding-top: 0; }
  .ui-refresh .return-owner-reasons > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; padding: 10px 2px; cursor: pointer; list-style: none; color: var(--primary-800); font-size: .82rem; font-weight: 700; border-radius: 6px; }
  .ui-refresh .return-owner-reasons > summary::-webkit-details-marker { display: none; }
  .ui-refresh .return-owner-reasons > summary::after { content: ''; width: 8px; height: 8px; flex: 0 0 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); margin-inline-end: 5px; }
  .ui-refresh .return-owner-reasons[open] > summary::after { transform: rotate(225deg); }
  .ui-refresh .return-owner-reasons > summary:focus-visible { outline: 2px solid var(--primary-700); outline-offset: 3px; }
  .ui-refresh .return-owner-reasons .return-reason-list { padding-top: 4px; overflow-wrap: anywhere; }

  /* The visit form remains one form with the same fields and submission. */
  .ui-refresh .form-section-nav { display: flex; gap: 8px; padding: 9px; margin-bottom: 22px; background: #fff; border: 1px solid #e0e9e2; border-radius: 14px; overflow-x: auto; }
  .ui-refresh .form-section-nav a { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 9px 13px; flex: 1 0 auto; color: #436c51; font-size: .83rem; font-weight: 700; border-radius: 9px; }
  .ui-refresh .form-section-nav a:hover { background: #edf5ef; }
  .ui-refresh .form-section-nav span { font-size: .71rem; color: #617866; font-weight: 500; }
  .ui-refresh #visit-form.form-card { padding: 0; background: transparent; border: 0; box-shadow: none; }
  .ui-refresh #visit-form > section,.ui-refresh #visit-form > .review-actions { background: #fff; border: 1px solid #dfe8e1; border-radius: 18px; padding: 28px; margin-bottom: 24px; box-shadow: 0 3px 16px #193e2803; }
  .ui-refresh #visit-form > hr.section-divider { display: none; }
  .ui-refresh #visit-form > .save-state { display: block; margin-bottom: 16px; color: #65816e; font-size: .85rem; }
  .ui-refresh #visit-form .section-header { padding-bottom: 19px; margin-bottom: 23px; border-bottom: 1px solid #e8eee9; }
  .ui-refresh #visit-form h2 { scroll-margin-top: 104px; }
  .ui-refresh .form-grid { gap: 22px 18px; grid-template-columns: repeat(2,minmax(0,1fr)); }
  .ui-refresh .visit-kind-field { padding: 20px; border-color: #e1eae3; background: #f6faf7; }
  .ui-refresh .visit-kind-options { margin-top: 8px; }
  .ui-refresh .field-group label.visit-kind-option { min-height: 120px; box-shadow: none; padding: 20px; }
  .ui-refresh .field-group label.visit-kind-option:has(input:checked) { background: #edf7f0; border-color: #4e9367; box-shadow: 0 0 0 2px #458a5914; }
  .ui-refresh .visit-kind-option:hover { transform: none; }
  .ui-refresh .visit-kind-copy small { color: #5c7965; line-height: 1.8; }
  .ui-refresh .description-tools { border-color: #dce9df; background: #f1f7f3; padding: 18px; border-radius: 12px; }
  .ui-refresh #description { min-height: 190px; line-height: 1.9; }
  .ui-refresh .upload-zone { background: #f9fbf9; border: 1px dashed #9fbea8; border-radius: 15px; padding: 32px 20px; }
  .ui-refresh .upload-zone h3 { font-size: 1.13rem; margin-top: 14px; }
  .ui-refresh .upload-zone p { margin-block: 8px 18px; font-size: .85rem; }
  .ui-refresh .image-preview-list { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
  .ui-refresh .signature-canvas { border-color: #b8d0c0; border-radius: 13px; box-shadow: inset 0 0 0 5px #f8faf8; }
  .ui-refresh .signature-actions > button { font-size: .85rem; }
  .ui-refresh .rejection-note { border-radius: 12px; line-height: 1.9; }

  /* Details and review surfaces; intentionally excludes report-sheet markup. */
  .ui-refresh[data-page='visit-details'] .page-heading { align-items: stretch; flex-direction: column; }
  .ui-refresh #details-actions { padding: 18px; background: #fff; border: 1px solid #dfe8e1; border-radius: 16px; gap: 10px; }
  .ui-refresh .report-export-choice { background: #f4f8f5; border-color: #e0eae3; }
  .ui-refresh #visit-details-content.details-grid { grid-template-columns: minmax(0,1.7fr) minmax(280px,1fr); gap: 22px; align-items: start; }
  .ui-refresh .detail-list { margin-top: 20px; gap: 0 24px; }
  .ui-refresh .detail-item { padding: 16px 0; border-color: #e8eee9; min-width: 0; }
  .ui-refresh .detail-item > span { color: #617768; font-size: .8rem; margin-bottom: 6px; }
  .ui-refresh .detail-item > strong { color: #264d34; font-weight: 700; font-size: .95rem; overflow-wrap: anywhere; line-height: 1.8; }
  .ui-refresh .description-box { background: #f5f8f5; border: 1px solid #e6ede7; border-radius: 12px; line-height: 2; padding: 18px; color: #435e49; font-size: .95rem; }
  .ui-refresh .photo-card { margin: 0; border-radius: 13px; border-color: #dfe8e1; padding: 9px; }
  .ui-refresh .photo-card img { border-radius: 9px; }
  .ui-refresh .photo-card figcaption { font-size: .78rem; color: #627968; padding: 10px 4px 3px; overflow-wrap: anywhere; }
  .ui-refresh .details-gallery { gap: 16px; margin-top: 20px; }
  .ui-refresh .support-review-panel > .muted { font-size: .86rem; line-height: 1.9; margin-block: 10px 20px; }
  .ui-refresh .support-review-fields { gap: 20px; }
  .ui-refresh .signature-readonly-card { border-color: #e0e8e2; border-radius: 13px; background: #fcfdfc; }

  /* People, workload, timelines and all screen dialogs. */
  .ui-refresh .users-filter { grid-template-columns: minmax(240px,2fr) repeat(3,minmax(130px,1fr)); }
  .ui-refresh .users-filter .search-wrap input { padding-inline-start: 14px !important; }
  .ui-refresh .user-actions-popover { border-radius: 13px; box-shadow: 0 14px 40px #12342520; }
  .ui-refresh .workflow-page,.ui-refresh #report-content { gap: 26px; }
  .ui-refresh .workflow-scope { border-radius: 10px; background: #f4f8f5; color: #5a7362; border-inline-start-color: #87aa92; font-size: .85rem; line-height: 1.9; }
  .ui-refresh .workflow-person { background: #fff; border: 1px solid #dce7df; border-radius: 17px; padding: 24px; box-shadow: 0 4px 20px #15362404; }
  .ui-refresh .workflow-person h3 { font-size: 1.13rem; }
  .ui-refresh .workflow-person h4 { color: #54755e; font-size: .84rem; }
  .ui-refresh .workload-metric { border-radius: 11px; background: #f9fbf9; border-color: #e0e9e2; }
  .ui-refresh .workload-metric.is-current { background: #edf6ef; border-color: #c1dbc9; }
  .ui-refresh .workload-metric strong { color: #245c39; font-variant-numeric: tabular-nums; }
  .ui-refresh .workload-upcoming { background: #fafbf9; border-color: #e2e7df; }
  .ui-refresh .workflow-event { border-radius: 13px; background: #fff; }
  .ui-refresh .workflow-visit-row,.ui-refresh .workload-visit { border-color: #dfe8e2; border-radius: 12px; }
  .ui-refresh .modal-backdrop { background: #112c2399; backdrop-filter: blur(4px); }
  .ui-refresh .modal { border: 1px solid #e1e9e3; border-radius: 20px; padding: 28px; box-shadow: 0 24px 80px #071c2640; max-height: calc(100dvh - 36px); }
  .ui-refresh :is(.workflow-dialog,.employee-report-dialog) { border-color: #dbe7de; border-radius: 20px; box-shadow: 0 24px 90px #112c2940; }
  .ui-refresh :is(.workflow-dialog,.employee-report-dialog)::backdrop { background: #112c2399; backdrop-filter: blur(4px); }
  .ui-refresh :is(.workflow-dialog-header,.employee-report-header) { background: #f7faf8; border-bottom: 1px solid #e3ece5; }
  .ui-refresh :is(.workflow-dialog-footer,.employee-report-footer) { background: #f7faf8; border-top: 1px solid #e3ece5; }
  .ui-refresh .toast { border-radius: 12px; box-shadow: 0 12px 32px #102c252b; line-height: 1.7; }

  /* Login: one quiet, purposeful welcome panel beside the existing form. */
  .ui-refresh.auth-page { padding: 32px; background: #f2f6f3; }
  .ui-refresh.auth-page::before { display: none; }
  .ui-refresh .auth-shell { width: min(1100px,100%); display: grid; grid-template-columns: 1fr 1fr; gap: 0; align-items: stretch; border: 1px solid #dce6df; border-radius: 24px; overflow: hidden; box-shadow: 0 20px 70px #173f3012; background: #fff; }
  .ui-refresh .auth-card { width: 100%; padding: 48px 40px 30px; border: 0; border-radius: 0; box-shadow: none; background: #fff; }
  .ui-refresh .auth-card .brand-mark { display: none; }
  .ui-refresh .auth-card .brand-block { margin-bottom: 30px; }
  .ui-refresh .auth-card h1 { font-size: 1.62rem; margin-block: 8px 12px; }
  .ui-refresh .auth-card .subtle { font-size: .9rem; }
  .ui-refresh .auth-card .stack { gap: 19px; }
  .ui-refresh .auth-card .primary-btn { min-height: 52px; background: #176347; }
  .ui-refresh .auth-story { background: #124731; padding: 38px; display: flex; flex-direction: column; justify-content: space-between; gap: 42px; color: #fff; position: relative; }
  .ui-refresh .auth-story-brand { display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: .93rem; }
  .ui-refresh .auth-story-mark { width: 46px; height: 46px; padding: 9px; border: 1px solid #cee5d64a; border-radius: 13px; color: #dbf1e2; }
  .ui-refresh .auth-story-mark svg { width: 100%; }
  .ui-refresh .auth-story-brand small { display: block; margin-top: 5px; font-size: .73rem; font-weight: 400; color: #a4c7af; }
  .ui-refresh .auth-story-copy .eyebrow { color: #aacaad; margin-bottom: 16px; }
  .ui-refresh .auth-story-copy h2 { font-size: clamp(2rem,3.6vw,3rem); line-height: 1.6; letter-spacing: -.025em; }
  .ui-refresh .auth-story-copy > p:last-child { color: #c4dbc9; font-size: .95rem; line-height: 1.9; margin-top: 16px; max-width: 340px; }
  .ui-refresh .auth-story-route { list-style: none; padding: 0; margin: 0; display: grid; gap: 0; }
  .ui-refresh .auth-story-route li { display: flex; gap: 16px; align-items: center; padding: 15px 0; border-bottom: 1px solid #bfdbc922; }
  .ui-refresh .auth-story-route li:last-child { border: 0; }
  .ui-refresh .auth-story-route li > span { font-size: .83rem; color: #afcdba; width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid #afcdba45; border-radius: 50%; }
  .ui-refresh .auth-story-route strong { font-size: .92rem; }
  .ui-refresh .auth-story-route small { display: block; color: #a8c8b4; font-size: .77rem; margin-top: 3px; }

  /* Consistent layouts from compact phones through large workstations. */
  @media (min-width: 1640px) { .ui-refresh .form-grid { grid-template-columns: repeat(4,minmax(0,1fr)); } }
  @media (min-width: 1180px) and (max-width: 1439px) {
    .ui-refresh .page-container { width: calc(100% - 44px); }
    .ui-refresh .stats-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
    .ui-refresh .users-filter { grid-template-columns: repeat(3,minmax(0,1fr)); }
    .ui-refresh .users-filter .search-wrap { grid-column: 1/-1; }
    .ui-refresh #visit-details-content.details-grid { grid-template-columns: minmax(0,1fr); }
    .ui-refresh .details-gallery { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }
    .ui-refresh .records-page .visits-filter { grid-template-columns: repeat(3,minmax(0,1fr)); }
  }
  @media (max-width: 1179px) {
    .ui-refresh .page-container { width: calc(100% - 40px); padding-top: 28px; }
    .ui-refresh #visit-details-content.details-grid { grid-template-columns: minmax(0,1fr); }
    .ui-refresh .details-gallery { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }
    .ui-refresh .users-filter { grid-template-columns: repeat(2,minmax(0,1fr)); }
  }
  @media (max-width: 767px) {
    .ui-refresh .page-container { width: calc(100% - 28px); padding-block: 24px calc(94px + env(safe-area-inset-bottom,0px)); }
    .ui-refresh .header-inner { width: calc(100% - 28px); min-height: 68px; gap: 10px; }
    .ui-refresh .app-brand { gap: 9px; font-size: .86rem; }
    .ui-refresh .app-brand-copy { max-width: 235px; line-height: 1.4; }
    .ui-refresh .app-brand-copy small { font-size: .65rem; }
    .ui-refresh .page-heading { margin-bottom: 22px; align-items: stretch; gap: 16px; }
    .ui-refresh .page-heading .subtle { font-size: .87rem; }
    .ui-refresh .page-heading > :is(a,button) { align-self: flex-start; }
    .ui-refresh .mobile-quick-nav { display: flex; position: fixed; z-index: 720; inset-inline: 0; bottom: 0; padding: 7px max(16px,env(safe-area-inset-left,0px)) calc(7px + env(safe-area-inset-bottom,0px)); background: #fff; border-top: 1px solid #dfe8e1; box-shadow: 0 -5px 20px #173f3008; gap: 8px; }
    .ui-refresh .mobile-quick-nav a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 49px; color: #6b8072; font-size: .73rem; border-radius: 9px; }
    .ui-refresh .mobile-quick-nav a.active { color: #175c39; background: #eef6f0; font-weight: 800; }
    .ui-refresh .mobile-quick-nav .icon { width: 21px; height: 21px; }
    .ui-refresh:is(.drawer-open,.image-upload-progress-open) .mobile-quick-nav { visibility: hidden; }
    .ui-refresh #toast-root { bottom: calc(84px + env(safe-area-inset-bottom,0px)); }
    .ui-refresh .page-container .panel { padding: 20px; }
    .ui-refresh .hero-strip { padding: 25px; min-height: 0; gap: 24px; align-items: stretch; }
    .ui-refresh .hero-strip h1 { font-size: 1.5rem; }
    .ui-refresh .hero-strip .page-actions { flex: auto; width: 100%; gap: 9px; }
    .ui-refresh .stats-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 11px; }
    .ui-refresh .stat-card { min-height: 134px; padding: 20px 16px; }
    .ui-refresh .stat-value { font-size: 2.05rem; }
    .ui-refresh .stat-head { font-size: .78rem; }
    .ui-refresh .filter-bar { padding: 14px; gap: 12px; }
    .ui-refresh .dashboard-filter,.ui-refresh .users-filter { grid-template-columns: minmax(0,1fr); }
    .ui-refresh .section-header { align-items: stretch; }
    .ui-refresh .section-header > :is(a,button) { align-self: flex-start; }
    .ui-refresh .return-analytics-summary { grid-template-columns: minmax(0,1fr); }
    .ui-refresh .return-analytics-summary article { min-height: 64px; }
    .ui-refresh .form-section-nav { margin-inline: -1px; border-radius: 12px; padding: 6px; }
    .ui-refresh .form-section-nav a { font-size: .78rem; padding-inline: 12px; }
    .ui-refresh #visit-form > section,.ui-refresh #visit-form > .review-actions { padding: 20px; margin-bottom: 18px; }
    .ui-refresh .form-grid { grid-template-columns: minmax(0,1fr); gap: 20px; }
    .ui-refresh .form-grid .span-2 { grid-column: auto; }
    .ui-refresh .visit-kind-options { grid-template-columns: minmax(0,1fr); }
    .ui-refresh .visit-kind-field { padding: 14px; }
    .ui-refresh .field-group label.visit-kind-option { min-height: 112px; padding: 16px; grid-template-columns: 36px minmax(0,1fr) 22px; gap: 10px; }
    .ui-refresh .visit-kind-icon { width: 36px; height: 38px; }
    .ui-refresh .visit-kind-copy strong { font-size: .93rem; }
    .ui-refresh .visit-kind-copy small { font-size: .78rem; }
    .ui-refresh .description-tools { padding: 15px; }
    .ui-refresh .image-preview-list { grid-template-columns: minmax(0,1fr); }
    .ui-refresh #details-actions { padding: 14px; }
    .ui-refresh #details-actions > button { flex: 1 1 140px; }
    .ui-refresh .report-export-choice { padding: 12px; }
    .ui-refresh .report-export-choice select { min-width: 0; width: 100%; }
    .ui-refresh .detail-list { grid-template-columns: minmax(0,1fr); }
    .ui-refresh .details-gallery { grid-template-columns: minmax(0,1fr); }
    .ui-refresh .signature-readonly-grid { grid-template-columns: minmax(0,1fr); }
    .ui-refresh .workflow-page .panel { gap: 18px; }
    .ui-refresh .workflow-people { grid-template-columns: minmax(0,1fr); }
    .ui-refresh .workflow-person { padding: 20px; }
    .ui-refresh .modal { padding: 22px; border-radius: 17px; max-height: calc(100dvh - 24px); }
    .ui-refresh .modal-actions { gap: 10px; }
    .ui-refresh.auth-page { padding: 18px; }
    .ui-refresh .auth-shell { max-width: 490px; grid-template-columns: 1fr; border-radius: 20px; }
    .ui-refresh .auth-story { padding: 23px 26px; gap: 20px; }
    .ui-refresh .auth-story-brand { font-size: .85rem; }
    .ui-refresh .auth-story-copy h2 { font-size: 1.65rem; line-height: 1.55; }
    .ui-refresh .auth-story-copy h2 br { display: none; }
    .ui-refresh .auth-story-copy > p:last-child { font-size: .8rem; margin-top: 8px; }
    .ui-refresh .auth-story-copy .eyebrow,.ui-refresh .auth-story-route { display: none; }
    .ui-refresh .auth-card { padding: 28px 24px 22px; }
    .ui-refresh .auth-card h1 { font-size: 1.35rem; }
  }
  @media (max-width: 374px) {
    .ui-refresh .page-container { width: calc(100% - 20px); }
    .ui-refresh .page-container .panel,.ui-refresh #visit-form > section,.ui-refresh #visit-form > .review-actions { padding: 16px; }
    .ui-refresh .app-brand-copy { max-width: 200px; }
    .ui-refresh .page-heading h1 { font-size: 1.55rem; }
    .ui-refresh .auth-card { padding: 24px 18px; }
    .ui-refresh .auth-story { padding: 22px; }
    .ui-refresh .workflow-period { grid-template-columns: minmax(0,1fr); }
  }
  @media (prefers-reduced-motion: reduce) {
    html:has(.ui-refresh) { scroll-behavior: auto; }
    .ui-refresh :is(a,button,input,select,textarea,.drawer) { transition: none !important; }
  }
}
@media print { .ui-refresh .mobile-quick-nav,.ui-refresh .skip-link,.ui-refresh .form-section-nav,.ui-refresh .auth-story { display: none !important; } }
