
      /* Cairo (bundled, weights 400-700). Falls back to system fonts instantly. */
      @font-face {
        font-family: "Cairo";
        font-style: normal;
        font-weight: 400 700;
        font-display: swap;
        src: url("../fonts/cairo-arabic.woff2") format("woff2");
        unicode-range: U+0600-06FF, U+0750-077F, U+0870-0891, U+0897-08E1,
          U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF,
          U+FE70-FE74, U+FE76-FEFC;
      }
      @font-face {
        font-family: "Cairo";
        font-style: normal;
        font-weight: 400 700;
        font-display: swap;
        src: url("../fonts/cairo-latin.woff2") format("woff2");
        unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6,
          U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212,
          U+2215, U+FEFF, U+FFFD;
      }

      :root {
        --primary: #1a3c5e;
        --primary-light: #2563a8;
        --accent: #f0a500;
        --accent-soft: #fff3d0;
        --success: #16a34a;
        --success-soft: #dcfce7;
        --warning: #d97706;
        --warning-soft: #fef3c7;
        --danger: #dc2626;
        --danger-soft: #fee2e2;
        --bg: #f0f4f8;
        --card: #ffffff;
        --text: #1e293b;
        --text-soft: #64748b;
        --border: #e2e8f0;
        --shadow: 0 4px 24px rgba(26, 60, 94, 0.1);
        --shadow-lg: 0 8px 40px rgba(26, 60, 94, 0.16);
        --radius: 18px;
        --radius-sm: 10px;
      }

      * {
        margin: 0;
        padding: 0;
        box-sizing: border-box;
        -webkit-tap-highlight-color: transparent;
      }

      body {
        font-family: "Cairo", system-ui, "Segoe UI", Tahoma, Arial, sans-serif;
        background: var(--bg);
        color: var(--text);
        min-height: 100dvh;
        overflow-x: hidden;
      }

      /* ===== SCREENS ===== */
      .screen {
        display: none;
        min-height: 100dvh;
        flex-direction: column;
      }
      .screen.active {
        display: flex;
      }

      /* ===== LOGIN SCREEN ===== */
      #screen-login {
        background: linear-gradient(
          160deg,
          var(--primary) 0%,
          #0f2540 50%,
          #1a3c5e 100%
        );
        align-items: center;
        justify-content: center;
        padding: 32px 20px;
        position: relative;
        overflow: hidden;
      }

      #screen-login::before {
        content: "";
        position: absolute;
        width: 400px;
        height: 400px;
        border-radius: 50%;
        background: rgba(240, 165, 0, 0.08);
        top: -120px;
        left: -80px;
      }
      #screen-login::after {
        content: "";
        position: absolute;
        width: 300px;
        height: 300px;
        border-radius: 50%;
        background: rgba(37, 99, 168, 0.12);
        bottom: -80px;
        right: -60px;
      }

      .login-card {
        background: rgba(255, 255, 255, 0.1);
        border: 1px solid rgba(255, 255, 255, 0.15);
        border-radius: 28px;
        padding: 40px 28px 36px;
        width: 100%;
        max-width: 400px;
        position: relative;
        z-index: 1;
      }

      .login-logo {
        text-align: center;
        margin-bottom: 28px;
      }
      .login-logo .logo-icon {
        width: 72px;
        height: 72px;
        background: linear-gradient(135deg, var(--accent), #e8920a);
        border-radius: 20px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-size: 32px;
        margin-bottom: 16px;
        box-shadow: 0 8px 24px rgba(240, 165, 0, 0.35);
      }
      .login-logo h1 {
        color: #fff;
        font-size: 22px;
        font-weight: 800;
        letter-spacing: -0.3px;
      }
      .login-logo p {
        color: rgba(255, 255, 255, 0.6);
        font-size: 13px;
        margin-top: 4px;
      }

      .divider-text {
        text-align: center;
        color: rgba(255, 255, 255, 0.45);
        font-size: 13px;
        margin: 20px 0;
        position: relative;
      }
      .divider-text::before,
      .divider-text::after {
        content: "";
        position: absolute;
        top: 50%;
        width: 35%;
        height: 1px;
        background: rgba(255, 255, 255, 0.15);
      }
      .divider-text::before {
        right: 0;
      }
      .divider-text::after {
        left: 0;
      }

      .btn {
        width: 100%;
        min-height: 52px;
        border-radius: 14px;
        font-family: "Cairo", system-ui, "Segoe UI", Tahoma, Arial, sans-serif;
        font-size: 15px;
        font-weight: 700;
        border: none;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
        transition: all 0.2s ease;
        position: relative;
        overflow: hidden;
      }
      .btn:active {
        transform: scale(0.97);
      }
      .btn:disabled {
        opacity: 0.6;
        cursor: not-allowed;
      }

      .btn-google {
        background: #fff;
        color: #1e293b;
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
      }
      .btn-google:hover {
        background: #f8fafc;
      }

      .btn-primary {
        background: linear-gradient(135deg, var(--accent), #e8920a);
        color: #fff;
        box-shadow: 0 4px 16px rgba(240, 165, 0, 0.4);
      }
      .btn-primary:hover {
        box-shadow: 0 6px 24px rgba(240, 165, 0, 0.5);
      }

      .btn-outline {
        background: rgba(255, 255, 255, 0.1);
        color: #fff;
        border: 1px solid rgba(255, 255, 255, 0.25);
      }

      .btn-success {
        background: linear-gradient(135deg, #16a34a, #15803d);
        color: #fff;
        box-shadow: 0 4px 16px rgba(22, 163, 74, 0.4);
      }

      .btn-danger {
        background: linear-gradient(135deg, #dc2626, #b91c1c);
        color: #fff;
        box-shadow: 0 4px 16px rgba(220, 38, 38, 0.4);
      }

      .btn-ghost {
        background: var(--border);
        color: var(--text-soft);
      }

      .phone-group {
        margin-bottom: 12px;
      }
      .phone-group label {
        color: rgba(255, 255, 255, 0.7);
        font-size: 13px;
        font-weight: 600;
        display: block;
        margin-bottom: 8px;
      }
      .phone-input {
        width: 100%;
        height: 52px;
        background: rgba(255, 255, 255, 0.1);
        border: 1px solid rgba(255, 255, 255, 0.2);
        border-radius: 14px;
        padding: 0 16px;
        color: #fff;
        font-family: "Cairo", system-ui, "Segoe UI", Tahoma, Arial, sans-serif;
        font-size: 16px;
        direction: ltr;
        text-align: center;
        outline: none;
        transition: border-color 0.2s;
      }
      .phone-input:focus {
        border-color: var(--accent);
      }
      .phone-input::placeholder {
        color: rgba(255, 255, 255, 0.35);
      }

      /* ===== MAIN APP SCREEN ===== */
      #screen-app {
        background: var(--bg);
        flex-direction: column;
      }

      .app-header {
        background: linear-gradient(135deg, var(--primary), #1e4d7b);
        padding: 20px 20px 28px;
        position: relative;
        overflow: hidden;
      }
      .app-header::after {
        content: "";
        position: absolute;
        bottom: -16px;
        left: 0;
        right: 0;
        height: 32px;
        background: var(--bg);
        border-radius: 32px 32px 0 0;
      }
      .header-top {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-bottom: 16px;
      }
      .header-greeting h2 {
        color: #fff;
        font-size: 18px;
        font-weight: 800;
      }
      .header-greeting p {
        color: rgba(255, 255, 255, 0.6);
        font-size: 13px;
        margin-top: 2px;
      }
      .header-avatar {
        width: 46px;
        height: 46px;
        background: rgba(255, 255, 255, 0.15);
        border: 2px solid rgba(255, 255, 255, 0.3);
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 20px;
        cursor: pointer;
      }
      .header-date {
        background: rgba(255, 255, 255, 0.12);
        border-radius: 12px;
        padding: 10px 16px;
        display: flex;
        align-items: center;
        gap: 8px;
      }
      .header-date span {
        color: rgba(255, 255, 255, 0.9);
        font-size: 14px;
        font-weight: 600;
      }

      .app-content {
        flex: 1;
        padding: 16px 16px 32px;
        overflow-y: auto;
      }

      /* Status Card */
      .status-card {
        background: var(--card);
        border-radius: var(--radius);
        padding: 20px;
        margin-bottom: 16px;
        box-shadow: var(--shadow);
        border: 1px solid var(--border);
      }

      .status-badge {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        padding: 6px 14px;
        border-radius: 20px;
        font-size: 13px;
        font-weight: 700;
        margin-bottom: 16px;
      }
      .badge-present {
        background: var(--success-soft);
        color: var(--success);
      }
      .badge-late {
        background: var(--warning-soft);
        color: var(--warning);
      }
      .badge-absent {
        background: var(--danger-soft);
        color: var(--danger);
      }
      .badge-pending {
        background: #e0f2fe;
        color: #0369a1;
      }

      .time-row {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 12px;
      }
      .time-box {
        background: var(--bg);
        border-radius: var(--radius-sm);
        padding: 14px;
        text-align: center;
      }
      .time-box .label {
        font-size: 11px;
        color: var(--text-soft);
        font-weight: 600;
        margin-bottom: 4px;
        text-transform: uppercase;
        letter-spacing: 0.5px;
      }
      .time-box .value {
        font-size: 22px;
        font-weight: 800;
        color: var(--text);
        direction: ltr;
      }
      .time-box .value.check-in {
        color: var(--success);
      }
      .time-box .value.check-out {
        color: var(--primary-light);
      }
      .time-box .value.empty {
        color: var(--border);
        font-size: 18px;
      }

      /* Action Buttons */
      .action-section {
        margin-bottom: 16px;
      }
      .action-section h3 {
        font-size: 13px;
        font-weight: 700;
        color: var(--text-soft);
        margin-bottom: 10px;
        padding-right: 4px;
        text-transform: uppercase;
        letter-spacing: 0.5px;
      }

      .action-btn {
        width: 100%;
        min-height: 58px;
        border-radius: var(--radius);
        font-family: "Cairo", system-ui, "Segoe UI", Tahoma, Arial, sans-serif;
        font-size: 16px;
        font-weight: 800;
        border: none;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
        transition: all 0.2s ease;
        box-shadow: var(--shadow);
        margin-bottom: 10px;
      }
      .action-btn:active {
        transform: scale(0.98);
      }
      .action-btn:disabled {
        opacity: 0.5;
        cursor: not-allowed;
      }

      .action-btn.checkin {
        background: linear-gradient(135deg, var(--success), #15803d);
        color: #fff;
        box-shadow: 0 4px 20px rgba(22, 163, 74, 0.4);
      }
      .action-btn.checkout {
        background: linear-gradient(
          135deg,
          var(--primary-light),
          var(--primary)
        );
        color: #fff;
        box-shadow: 0 4px 20px rgba(37, 99, 168, 0.4);
      }

      /* History */
      .history-card {
        background: var(--card);
        border-radius: var(--radius);
        padding: 16px;
        box-shadow: var(--shadow);
        border: 1px solid var(--border);
      }
      .history-card h3 {
        font-size: 15px;
        font-weight: 800;
        color: var(--text);
        margin-bottom: 14px;
        padding-bottom: 12px;
        border-bottom: 2px solid var(--bg);
      }

      .history-item {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 12px 0;
        border-bottom: 1px solid var(--bg);
      }
      .history-item:last-child {
        border-bottom: none;
        padding-bottom: 0;
      }
      .history-dot {
        width: 10px;
        height: 10px;
        border-radius: 50%;
        flex-shrink: 0;
      }
      .dot-present {
        background: var(--success);
      }
      .dot-late {
        background: var(--warning);
      }
      .dot-absent {
        background: var(--danger);
      }
      .history-info {
        flex: 1;
      }
      .history-info .date {
        font-size: 13px;
        font-weight: 700;
        color: var(--text);
      }
      .history-info .times {
        font-size: 12px;
        color: var(--text-soft);
        margin-top: 2px;
        direction: ltr;
        text-align: right;
      }
      .history-status {
        font-size: 12px;
        font-weight: 700;
        padding: 4px 10px;
        border-radius: 20px;
      }

      /* ===== MODAL / OVERLAY ===== */
      .modal-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.75);
        z-index: 100;
        display: none;
        align-items: flex-end;
      }
      .modal-overlay.active {
        display: flex;
      }

      .modal-sheet {
        background: var(--card);
        border-radius: 28px 28px 0 0;
        padding: 24px 20px 40px;
        width: 100%;
        max-height: 92dvh;
        overflow-y: auto;
        animation: slideUp 0.3s ease;
      }
      @keyframes slideUp {
        from {
          transform: translateY(100%);
        }
        to {
          transform: translateY(0);
        }
      }

      .modal-handle {
        width: 40px;
        height: 4px;
        background: var(--border);
        border-radius: 2px;
        margin: 0 auto 20px;
      }
      .modal-title {
        font-size: 18px;
        font-weight: 800;
        color: var(--text);
        margin-bottom: 20px;
        text-align: center;
      }

      /* Steps inside modal */
      .step {
        display: none;
      }
      .step.active {
        display: block;
      }

      .step-indicator {
        display: flex;
        justify-content: center;
        gap: 8px;
        margin-bottom: 24px;
      }
      .step-dot {
        width: 8px;
        height: 8px;
        border-radius: 50%;
        background: var(--border);
        transition: all 0.3s;
      }
      .step-dot.active {
        background: var(--primary-light);
        width: 24px;
        border-radius: 4px;
      }
      .step-dot.done {
        background: var(--success);
      }

      /* GPS Step */
      .gps-card {
        background: var(--bg);
        border-radius: var(--radius);
        padding: 28px 20px;
        text-align: center;
        margin-bottom: 20px;
      }
      .gps-icon {
        font-size: 52px;
        margin-bottom: 12px;
        display: block;
      }
      @keyframes pulse {
        0%,
        100% {
          transform: scale(1);
        }
        50% {
          transform: scale(1.08);
        }
      }
      .gps-status {
        font-size: 15px;
        font-weight: 700;
        color: var(--text);
      }
      .gps-sub {
        font-size: 13px;
        color: var(--text-soft);
        margin-top: 6px;
      }

      .distance-badge {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        padding: 8px 16px;
        border-radius: 20px;
        font-size: 14px;
        font-weight: 700;
        margin-top: 12px;
      }

      /* Camera Step */
      .camera-container {
        border-radius: var(--radius);
        overflow: hidden;
        background: #000;
        aspect-ratio: 3/4;
        margin-bottom: 16px;
        position: relative;
      }
      #camera-preview,
      #camera-canvas {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
      }
      #camera-canvas {
        display: none;
      }

      .camera-overlay {
        position: absolute;
        inset: 0;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: flex-end;
        padding: 20px;
        background: linear-gradient(
          to top,
          rgba(0, 0, 0, 0.5) 0%,
          transparent 50%
        );
      }
      .capture-btn {
        width: 70px;
        height: 70px;
        border-radius: 50%;
        border: 4px solid #fff;
        background: rgba(255, 255, 255, 0.2);
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 28px;
        transition: all 0.2s;
      }
      .capture-btn:active {
        transform: scale(0.92);
        background: rgba(255, 255, 255, 0.4);
      }

      .camera-face-guide {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -55%);
        width: 60%;
        aspect-ratio: 1;
        border: 2px solid rgba(255, 255, 255, 0.5);
        border-radius: 50%;
        pointer-events: none;
      }

      /* Photo Preview */
      .photo-preview {
        border-radius: var(--radius);
        overflow: hidden;
        aspect-ratio: 3/4;
        margin-bottom: 16px;
        position: relative;
        background: #000;
      }
      .photo-preview img {
        width: 100%;
        height: 100%;
        object-fit: cover;
      }
      .photo-preview .confirm-overlay {
        position: absolute;
        inset: 0;
        background: linear-gradient(
          to top,
          rgba(0, 0, 0, 0.6) 0%,
          transparent 50%
        );
        display: flex;
        align-items: flex-end;
        justify-content: center;
        padding: 20px;
      }

      .two-btns {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 12px;
        margin-top: 8px;
      }

      /* Loading */
      .loading-overlay {
        position: fixed;
        inset: 0;
        background: rgba(26, 60, 94, 0.7);
        z-index: 200;
        display: none;
        align-items: center;
        justify-content: center;
        flex-direction: column;
        gap: 20px;
      }
      .loading-overlay.active {
        display: flex;
      }
      .spinner {
        width: 52px;
        height: 52px;
        border: 4px solid rgba(255, 255, 255, 0.2);
        border-top-color: var(--accent);
        border-radius: 50%;
        animation: spin 0.8s linear infinite;
      }
      @keyframes spin {
        to {
          transform: rotate(360deg);
        }
      }
      .loading-text {
        color: #fff;
        font-size: 15px;
        font-weight: 700;
      }

      /* Toast */
      .toast {
        position: fixed;
        bottom: 24px;
        left: 50%;
        transform: translateX(-50%) translateY(100px);
        background: var(--text);
        color: #fff;
        padding: 14px 24px;
        border-radius: 16px;
        font-size: 14px;
        font-weight: 700;
        z-index: 300;
        transition: transform 0.3s ease;
        white-space: nowrap;
        max-width: 90vw;
        text-align: center;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
      }
      .toast.show {
        transform: translateX(-50%) translateY(0);
      }
      .toast.success {
        background: var(--success);
      }
      .toast.error {
        background: var(--danger);
      }
      .toast.warning {
        background: var(--warning);
      }

      /* Info Row */
      .info-row {
        display: flex;
        align-items: center;
        gap: 10px;
        background: var(--bg);
        border-radius: var(--radius-sm);
        padding: 12px 14px;
        margin-bottom: 10px;
      }
      .info-row .icon {
        font-size: 18px;
      }
      .info-row .info-text {
        font-size: 13px;
        font-weight: 700;
        color: var(--text);
      }
      .info-row .info-sub {
        font-size: 12px;
        color: var(--text-soft);
      }

      /* Name input in modal */
      .name-input-group label {
        font-size: 13px;
        font-weight: 700;
        color: var(--text-soft);
        display: block;
        margin-bottom: 8px;
      }
      .name-input {
        width: 100%;
        height: 52px;
        background: var(--bg);
        border: 2px solid var(--border);
        border-radius: 14px;
        padding: 0 16px;
        font-family: "Cairo", system-ui, "Segoe UI", Tahoma, Arial, sans-serif;
        font-size: 15px;
        font-weight: 600;
        color: var(--text);
        outline: none;
        transition: border-color 0.2s;
        margin-bottom: 14px;
      }
      .name-input:focus {
        border-color: var(--primary-light);
      }

      /* Success screen */
      .success-screen {
        text-align: center;
        padding: 20px 0;
      }
      .success-icon {
        font-size: 72px;
        margin-bottom: 16px;
        display: block;
        animation: bounce 0.5s ease;
      }
      @keyframes bounce {
        0% {
          transform: scale(0.5);
        }
        70% {
          transform: scale(1.1);
        }
        100% {
          transform: scale(1);
        }
      }
      .success-title {
        font-size: 22px;
        font-weight: 800;
        color: var(--text);
        margin-bottom: 8px;
      }
      .success-sub {
        font-size: 14px;
        color: var(--text-soft);
      }

      .info-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        margin: 20px 0;
      }
      .info-cell {
        background: var(--bg);
        border-radius: var(--radius-sm);
        padding: 12px;
        text-align: center;
      }
      .info-cell .cell-label {
        font-size: 11px;
        color: var(--text-soft);
        font-weight: 600;
        margin-bottom: 4px;
      }
      .info-cell .cell-value {
        font-size: 16px;
        font-weight: 800;
        color: var(--text);
      }

      /* Logout */
      .logout-btn {
        background: none;
        border: none;
        color: rgba(255, 255, 255, 0.6);
        font-family: "Cairo", system-ui, "Segoe UI", Tahoma, Arial, sans-serif;
        font-size: 13px;
        cursor: pointer;
        padding: 4px 8px;
        border-radius: 8px;
      }
      .logout-btn:active {
        background: rgba(255, 255, 255, 0.1);
      }

      /* OTP Input */
      .otp-input {
        width: 100%;
        height: 56px;
        background: rgba(255, 255, 255, 0.1);
        border: 1px solid rgba(255, 255, 255, 0.2);
        border-radius: 14px;
        padding: 0 16px;
        color: #fff;
        font-family: "Cairo", system-ui, "Segoe UI", Tahoma, Arial, sans-serif;
        font-size: 24px;
        font-weight: 800;
        direction: ltr;
        text-align: center;
        outline: none;
        letter-spacing: 8px;
        margin-bottom: 12px;
        transition: border-color 0.2s;
      }
      .otp-input:focus {
        border-color: var(--accent);
      }

      /* Work hours chip */
      .work-hours-chip {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        background: var(--accent-soft);
        color: var(--warning);
        padding: 8px 16px;
        border-radius: 20px;
        font-size: 14px;
        font-weight: 700;
        margin-top: 12px;
      }

      .section-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-bottom: 12px;
      }
      .section-header h3 {
        font-size: 16px;
        font-weight: 800;
        color: var(--text);
      }
      .see-all {
        font-size: 12px;
        color: var(--primary-light);
        font-weight: 700;
        text-decoration: none;
      }

      .empty-state {
        text-align: center;
        padding: 24px 0;
        color: var(--text-soft);
        font-size: 13px;
      }
      .empty-state .empty-icon {
        font-size: 32px;
        margin-bottom: 8px;
        display: block;
      }
    
      /* ===== Phase 1 additions ===== */
      button:disabled {
        opacity: 0.55;
        cursor: not-allowed;
      }
      .conn-banner {
        display: none;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        background: var(--warning-soft);
        border: 1px solid #fcd34d;
        color: #92400e;
        border-radius: 12px;
        padding: 10px 14px;
        margin-bottom: 14px;
        font-size: 13px;
        font-weight: 700;
      }
      .conn-banner.show {
        display: flex;
      }
      .btn-retry {
        background: var(--primary);
        color: #fff;
        border: none;
        border-radius: 8px;
        padding: 8px 14px;
        font-family: inherit;
        font-size: 13px;
        font-weight: 700;
        cursor: pointer;
        white-space: nowrap;
      }
      .save-error {
        display: none;
        background: var(--danger-soft);
        color: var(--danger);
        border-radius: 12px;
        padding: 12px 14px;
        margin-bottom: 12px;
        font-size: 13px;
        font-weight: 700;
        text-align: center;
        line-height: 1.7;
      }
      .save-error.show {
        display: block;
      }

      /* ===== Camera + confirm: full screen, buttons at the BOTTOM, nothing to scroll =====
         Layout (top to bottom): title, preview/photo (takes all free space),
         error message, buttons. Buttons never overlap the preview and stay clear
         of the iPhone home indicator (safe area). */
      .modal-sheet.fs {
        height: 100%;
        max-height: none;
        border-radius: 0;
        padding: calc(10px + env(safe-area-inset-top, 0px)) 12px
          calc(12px + env(safe-area-inset-bottom, 0px));
        display: flex;
        flex-direction: column;
        overflow: hidden;
        animation: none;
      }
      .modal-sheet.fs .modal-handle,
      .modal-sheet.fs .step-indicator,
      .modal-sheet.fs .info-row {
        display: none;
      }
      .modal-sheet.fs .modal-title {
        font-size: 15px;
        margin: 0 0 8px;
      }
      .modal-sheet.fs .step.active {
        display: flex;
        flex-direction: column;
        flex: 1;
        min-height: 0;
      }
      .modal-sheet.fs .camera-container,
      .modal-sheet.fs .photo-preview {
        flex: 1;
        min-height: 0;
        aspect-ratio: auto;
        margin: 0;
      }
      .modal-sheet.fs .photo-preview img {
        object-fit: contain;
      }
      .modal-sheet.fs .fs-bottom,
      .modal-sheet.fs #confirm-btns,
      .modal-sheet.fs #btn-save-close {
        flex: none;
        margin: 10px 0 0;
      }
      .modal-sheet.fs #save-error {
        flex: none;
        margin: 8px 0 0;
      }

      /* top of the app header / login: keep clear of the notch when installed */
      .app-header {
        padding-top: calc(20px + env(safe-area-inset-top, 0px));
      }

      /* ===== No zoom on touch ===== */
      html {
        -webkit-text-size-adjust: 100%;
        text-size-adjust: 100%;
      }
      html,
      body,
      * {
        touch-action: manipulation;
      }
      input,
      select,
      textarea {
        font-size: 16px;
      }

      /* short phones: make the location step compact so the retry button stays visible */
      @media (max-height: 680px) {
        .modal-sheet {
          padding: 14px 16px 20px;
        }
        .modal-handle {
          margin-bottom: 10px;
        }
        .modal-title {
          margin-bottom: 10px;
        }
        .step-indicator {
          margin-bottom: 12px;
        }
        .gps-card {
          padding: 16px 14px;
          margin-bottom: 10px;
        }
        .gps-icon {
          font-size: 38px;
          margin-bottom: 6px;
        }
        .modal-sheet:not(.fs) .info-row {
          display: none;
        }
      }

      /* ===== Week list (Thursday to today) - plain rows ===== */
      .week-range {
        font-size: 12px;
        color: var(--text-soft);
        margin: -6px 0 6px;
      }
      .wk-row {
        padding: 12px 0;
        border-bottom: 1px solid var(--bg);
      }
      .wk-row:last-child {
        border-bottom: none;
        padding-bottom: 0;
      }
      .wk-date {
        font-size: 14px;
        font-weight: 800;
        color: var(--text);
        margin-bottom: 4px;
      }
      .wk-vals {
        display: flex;
        flex-wrap: wrap;
        gap: 2px 14px;
        font-size: 13px;
        color: var(--text-soft);
      }
      .wk-part {
        white-space: nowrap;
      }
      /* only these two words are colored (darker shades so they read well on white) */
      .wk-off {
        color: #15803d;
        font-weight: 700;
      }
      .wk-absent {
        color: #b91c1c;
        font-weight: 700;
      }

      /* ===== Register another employee ===== */
      .action-btn.other {
        background: linear-gradient(135deg, #475569, #334155);
        color: #fff;
      }
      .other-search {
        width: 100%;
        height: 48px;
        border: 1px solid var(--border);
        border-radius: 12px;
        padding: 0 14px;
        font-family: inherit;
        font-size: 16px;
        margin-bottom: 10px;
        background: #fff;
        color: var(--text);
      }
      .other-list {
        max-height: 38vh;
        overflow-y: auto;
        margin-bottom: 10px;
      }
      .other-item {
        display: block;
        width: 100%;
        text-align: right;
        padding: 14px;
        margin-bottom: 8px;
        background: var(--bg);
        border: 1px solid var(--border);
        border-radius: 12px;
        font-family: inherit;
        font-size: 15px;
        font-weight: 700;
        color: var(--text);
        cursor: pointer;
      }
      .other-item:active {
        background: var(--accent-soft);
      }
      .other-picked {
        text-align: center;
        font-size: 18px;
        font-weight: 800;
        margin: 6px 0 16px;
      }

      /* ===== Saved screen (shown only after the server answered ok) ===== */
      .done-card {
        background: var(--success-soft);
        border-radius: var(--radius);
        padding: 28px 18px;
        text-align: center;
        margin-bottom: 16px;
      }
      .done-icon {
        font-size: 56px;
        display: block;
        margin-bottom: 10px;
      }
      .done-title {
        font-size: 19px;
        font-weight: 700;
        color: var(--success);
        line-height: 1.6;
      }
      .done-sub {
        font-size: 14px;
        color: var(--text);
        margin-top: 8px;
        line-height: 1.8;
      }
      .done-card.pending {
        background: var(--accent-soft);
      }
      .done-card.pending .done-title {
        color: var(--primary);
      }
      .btn-cancel-link {
        display: block;
        width: 100%;
        background: none;
        border: none;
        color: var(--text-soft);
        font-family: inherit;
        font-size: 14px;
        font-weight: 700;
        padding: 10px;
        margin-top: 4px;
        cursor: pointer;
      }
      .modal-sheet.fs #btn-cancel-confirm {
        flex: none;
        margin: 4px 0 0;
      }
